Browse Source

Fix prop bugs

foolsday
mittorn 9 years ago
parent
commit
344364cc71
  1. 13
      dlls/prop.cpp

13
dlls/prop.cpp

@ -253,6 +253,9 @@ void CProp::Precache( void )
{ {
const char *pGibName; const char *pGibName;
if( !pev->model )
pev->model = MAKE_STRING( "models/xash/barrel_brown.mdl" );
switch (m_Material) switch (m_Material)
{ {
case matWood: case matWood:
@ -687,7 +690,7 @@ void CProp::CheckRotate()
{ {
pev->angles.y += 90; pev->angles.y += 90;
ALERT(at_console, "setHorizontal: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z); ALERT(at_console, "setH: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z);
UTIL_SetSize(pev, minsH, maxsH); UTIL_SetSize(pev, minsH, maxsH);
} }
@ -698,6 +701,7 @@ void CProp::CheckRotate()
mins.z = pev->absmax.z; mins.z = pev->absmax.z;
maxs.z += 10; maxs.z += 10;
ALERT(at_console, "setV: %f %f %f\n", pev->angles.x, pev->angles.y, pev->angles.z);
// BUGBUG -- can only find 256 entities on a prop -- should be enough // BUGBUG -- can only find 256 entities on a prop -- should be enough
CBaseEntity *pList[256]; CBaseEntity *pList[256];
@ -865,9 +869,6 @@ void CProp::Spawn(void)
Precache(); Precache();
if( !pev->model )
pev->model = MAKE_STRING( "models/xash/barrel_brown.mdl" );
if( minsH == g_vecZero ) if( minsH == g_vecZero )
{ {
// default barrel parameters // default barrel parameters
@ -881,6 +882,8 @@ void CProp::Spawn(void)
spawnOrigin = pev->origin; spawnOrigin = pev->origin;
spawnAngles = pev->angles; spawnAngles = pev->angles;
m_flSpawnHealth = pev->health; m_flSpawnHealth = pev->health;
if( m_flSpawnHealth <= 0 )
m_flSpawnHealth = 30;
if( !m_flRespawnTime ) if( !m_flRespawnTime )
m_flRespawnTime = 20; m_flRespawnTime = 20;
pev->dmg = 100; pev->dmg = 100;
@ -896,6 +899,7 @@ void CProp::PropRespawn()
pev->velocity = pev->avelocity = g_vecZero; pev->velocity = pev->avelocity = g_vecZero;
SET_MODEL( ENT(pev), STRING(pev->model) ); SET_MODEL( ENT(pev), STRING(pev->model) );
UTIL_SetOrigin( pev, spawnOrigin ); UTIL_SetOrigin( pev, spawnOrigin );
m_oldshape = (PropShape)-1; m_oldshape = (PropShape)-1;
CheckRotate(); CheckRotate();
pev->health = m_flSpawnHealth; pev->health = m_flSpawnHealth;
@ -903,6 +907,7 @@ void CProp::PropRespawn()
SetUse( &CProp::Use); SetUse( &CProp::Use);
pev->effects &= ~EF_NODRAW; pev->effects &= ~EF_NODRAW;
pev->framerate = 1.0f; pev->framerate = 1.0f;
UTIL_SetOrigin( pev, spawnOrigin );
} }
void CProp::RespawnThink() void CProp::RespawnThink()

Loading…
Cancel
Save