more fixes

Why So Rushed? can no longer happen on d3_citadel_01
fixed a crash caused by NPCs being dissolved
minor optimization for Suppression Field Hiccup
This commit is contained in:
Pinsplash 2023-05-01 05:44:40 -05:00
parent c7b8e0514c
commit 0707c6c4ed
4 changed files with 11 additions and 6 deletions

View File

@ -5337,6 +5337,11 @@ bool CChaosEffect::CheckEffectContext()
|| !Q_strcmp(pMapName, "ep2_outland_01") || !Q_strcmp(pMapName, "ep2_outland_07") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_10a"))
return false;//bad map
//if we miss the trigger_changelevel, the pod will get killed, killing us
if (m_nID == EFFECT_CANT_LEAVE_MAP)
if (!Q_strcmp(pMapName, "d3_citadel_01"))
return false;
if (m_nContext == EC_NONE)
return true;
@ -7664,7 +7669,9 @@ void CECloneNPCs::StartEffect()
CBaseEntity *pNPC = gEntList.FindEntityByClassname(NULL, "n*");
while (pNPC)
{
if (pNPC->IsNPC())//avoid cloning non-NPC entities with an "npc_" prefix, like npc_maker
//avoid cloning non-NPC entities with an "npc_" prefix, like npc_maker
//avoid npc_furniture, it goes bad
if (pNPC->IsNPC() && !pNPC->ClassMatches("npc_furniture"))
vNPCs.AddToTail(*StoreEnt(pNPC));
pNPC = gEntList.FindEntityByClassname(pNPC, "n*");
}
@ -7673,8 +7680,6 @@ void CECloneNPCs::StartEffect()
CBaseEntity *pCloneNPC = RetrieveStoredEnt(&vNPCs[i], false);
if (pCloneNPC)
{
if (pCloneNPC->ClassMatches("npc_furniture"))
continue;//don't clone furniture's, bad stuff can happen
Vector vecOrigin = pCloneNPC->GetAbsOrigin();
QAngle vecAngle = pCloneNPC->GetAbsAngles();
DispatchSpawn(pCloneNPC);

View File

@ -838,7 +838,7 @@ bool CNPC_Manhack::CorpseGib( const CTakeDamageInfo &info )
vecGibAVelocity.z = random->RandomFloat( -500, 500 );
}
PropBreakableCreateAll( GetModelIndex(), NULL, GetAbsOrigin(), GetAbsAngles(), vecGibVelocity, vecGibAVelocity, 1.0, 60, COLLISION_GROUP_DEBRIS );
PropBreakableCreateAll( GetModelIndex(), NULL, GetAbsOrigin(), GetAbsAngles(), vecGibVelocity, vecGibAVelocity, 1.0, 60, COLLISION_GROUP_DEBRIS, this);
RemoveDeferred();

View File

@ -363,7 +363,7 @@ void CPhysicsCannister::Explode( CBaseEntity *pAttacker )
IPhysicsObject *pPhysics = VPhysicsGetObject();
pPhysics->GetVelocity( &velocity, &angVelocity );
PropBreakableCreateAll( GetModelIndex(), pPhysics, GetAbsOrigin(), GetAbsAngles(), velocity, angVelocity, 1.0, 20, COLLISION_GROUP_DEBRIS );
PropBreakableCreateAll( GetModelIndex(), pPhysics, GetAbsOrigin(), GetAbsAngles(), velocity, angVelocity, 1.0, 20, COLLISION_GROUP_DEBRIS, this);
ExplosionCreate( GetAbsOrigin(), GetAbsAngles(), pAttacker, m_damage, 0, true );
UTIL_Remove( this );
}

View File

@ -244,7 +244,7 @@ const char *GetMassEquivalent(float flMass);
int GetAutoMultiplayerPhysicsMode( Vector size, float mass );
void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup );
void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const breakablepropparams_t &params, CBaseEntity *pEntity, int iPrecomputedBreakableCount, bool bIgnoreGibLImit, bool defaultLocation = true );
void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const Vector &origin, const QAngle &angles, const Vector &velocity, const AngularImpulse &angularVelocity, float impactEnergyScale, float burstScale, int collisionGroup, CBaseEntity *pEntity = NULL, bool defaultLocation = true );
void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const Vector &origin, const QAngle &angles, const Vector &velocity, const AngularImpulse &angularVelocity, float impactEnergyScale, float burstScale, int collisionGroup, CBaseEntity *pEntity, bool defaultLocation = true );
// Player gibs.
void PrecacheGibsForModel( int iModel );