Browse Source

game(hl1): fix apache,can bbox, fix DROP_TO_FLOOR, fix barnacle

pull/114/head
nillerusr 2 years ago
parent
commit
faca1ab142
  1. 5
      game/server/effects.cpp
  2. 4
      game/server/hl1/hl1_npc_apache.cpp
  3. 8
      game/server/hl1/hl1_npc_barnacle.cpp
  4. 3
      game/server/util.cpp

5
game/server/effects.cpp

@ -1434,7 +1434,12 @@ void CItemSoda::CanThink ( void )
SetSolid( SOLID_BBOX ); SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_TRIGGER ); AddSolidFlags( FSOLID_TRIGGER );
#ifdef HL1_DLL
UTIL_SetSize(this, Vector(-16, -16, 0), Vector(16, 16, 16));
#else
UTIL_SetSize ( this, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) ); UTIL_SetSize ( this, Vector ( -8, -8, 0 ), Vector ( 8, 8, 8 ) );
#endif
SetThink ( NULL ); SetThink ( NULL );
SetTouch ( &CItemSoda::CanTouch ); SetTouch ( &CItemSoda::CanTouch );

4
game/server/hl1/hl1_npc_apache.cpp

@ -188,7 +188,9 @@ void CNPC_Apache::Spawn( void )
m_iRockets = 10; m_iRockets = 10;
UTIL_SetSize( this, Vector( -32, -32, -32 ), Vector( 32, 32, 32 ) ); Vector mins, maxs;
ExtractBbox(0, mins, maxs);
UTIL_SetSize(this, mins, maxs);
//CollisionProp()->SetSurroundingBoundsType( USE_SPECIFIED_BOUNDS, &s_vecSurroundingMins, &s_vecSurroundingMaxs ); //CollisionProp()->SetSurroundingBoundsType( USE_SPECIFIED_BOUNDS, &s_vecSurroundingMins, &s_vecSurroundingMaxs );
//AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST ); //AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST );

8
game/server/hl1/hl1_npc_barnacle.cpp

@ -384,9 +384,10 @@ void CNPC_Barnacle::BarnacleThink ( void )
} }
// ALERT( at_console, "tounge %f\n", m_flAltitude + m_flTongueAdj ); //Msg("tounge %f\n", m_flAltitude + m_flTongueAdj );
//NDebugOverlay::Box( GetAbsOrigin() - Vector( 0, 0, m_flAltitude ), Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), 255,255,255, 0, 0.1 ); //NDebugOverlay::Box( GetAbsOrigin() - Vector( 0, 0, m_flAltitude ), Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), 255,255,255, 0, 0.1 );
SetBoneController( 0, 0.f );
SetBoneController( 0, -(m_flAltitude + m_flTongueAdj) ); SetBoneController( 0, -(m_flAltitude + m_flTongueAdj) );
StudioFrameAdvance(); StudioFrameAdvance();
} }
@ -467,8 +468,11 @@ CBaseEntity *CNPC_Barnacle::TongueTouchEnt ( float *pflLength )
trace_t tr; trace_t tr;
float length; float length;
Vector origin(GetAbsOrigin());
origin.z -= 1.f;
// trace once to hit architecture and see if the tongue needs to change position. // trace once to hit architecture and see if the tongue needs to change position.
UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() - Vector ( 0 , 0 , 2048 ), UTIL_TraceLine ( origin, origin - Vector ( 0 , 0 , 2048 ),
MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr ); MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr );
length = fabs( GetAbsOrigin().z - tr.endpos.z ); length = fabs( GetAbsOrigin().z - tr.endpos.z );

3
game/server/util.cpp

@ -345,7 +345,7 @@ int UTIL_DropToFloor( CBaseEntity *pEntity, unsigned int mask, CBaseEntity *pIgn
trace_t trace; trace_t trace;
#ifndef HL2MP #if !defined(HL2MP) && !defined(HL1_DLL)
// HACK: is this really the only sure way to detect crossing a terrain boundry? // HACK: is this really the only sure way to detect crossing a terrain boundry?
UTIL_TraceEntity( pEntity, pEntity->GetAbsOrigin(), pEntity->GetAbsOrigin(), mask, pIgnore, pEntity->GetCollisionGroup(), &trace ); UTIL_TraceEntity( pEntity, pEntity->GetAbsOrigin(), pEntity->GetAbsOrigin(), mask, pIgnore, pEntity->GetCollisionGroup(), &trace );
if (trace.fraction == 0.0) if (trace.fraction == 0.0)
@ -354,6 +354,7 @@ int UTIL_DropToFloor( CBaseEntity *pEntity, unsigned int mask, CBaseEntity *pIgn
UTIL_TraceEntity( pEntity, pEntity->GetAbsOrigin(), pEntity->GetAbsOrigin() - Vector(0,0,256), mask, pIgnore, pEntity->GetCollisionGroup(), &trace ); UTIL_TraceEntity( pEntity, pEntity->GetAbsOrigin(), pEntity->GetAbsOrigin() - Vector(0,0,256), mask, pIgnore, pEntity->GetCollisionGroup(), &trace );
if (trace.allsolid) if (trace.allsolid)
return -1; return -1;

Loading…
Cancel
Save