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 ) @@ -253,6 +253,9 @@ void CProp::Precache( void )
{
const char *pGibName;
if( !pev->model )
pev->model = MAKE_STRING( "models/xash/barrel_brown.mdl" );
switch (m_Material)
{
case matWood:
@ -687,7 +690,7 @@ void CProp::CheckRotate() @@ -687,7 +690,7 @@ void CProp::CheckRotate()
{
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);
}
@ -698,6 +701,7 @@ void CProp::CheckRotate() @@ -698,6 +701,7 @@ void CProp::CheckRotate()
mins.z = pev->absmax.z;
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
CBaseEntity *pList[256];
@ -865,9 +869,6 @@ void CProp::Spawn(void) @@ -865,9 +869,6 @@ void CProp::Spawn(void)
Precache();
if( !pev->model )
pev->model = MAKE_STRING( "models/xash/barrel_brown.mdl" );
if( minsH == g_vecZero )
{
// default barrel parameters
@ -881,6 +882,8 @@ void CProp::Spawn(void) @@ -881,6 +882,8 @@ void CProp::Spawn(void)
spawnOrigin = pev->origin;
spawnAngles = pev->angles;
m_flSpawnHealth = pev->health;
if( m_flSpawnHealth <= 0 )
m_flSpawnHealth = 30;
if( !m_flRespawnTime )
m_flRespawnTime = 20;
pev->dmg = 100;
@ -896,6 +899,7 @@ void CProp::PropRespawn() @@ -896,6 +899,7 @@ void CProp::PropRespawn()
pev->velocity = pev->avelocity = g_vecZero;
SET_MODEL( ENT(pev), STRING(pev->model) );
UTIL_SetOrigin( pev, spawnOrigin );
m_oldshape = (PropShape)-1;
CheckRotate();
pev->health = m_flSpawnHealth;
@ -903,6 +907,7 @@ void CProp::PropRespawn() @@ -903,6 +907,7 @@ void CProp::PropRespawn()
SetUse( &CProp::Use);
pev->effects &= ~EF_NODRAW;
pev->framerate = 1.0f;
UTIL_SetOrigin( pev, spawnOrigin );
}
void CProp::RespawnThink()

Loading…
Cancel
Save