Update AFEntity.cpp

This commit is contained in:
ALord7 2024-08-27 11:19:58 +08:00 committed by GitHub
parent e228fea6f0
commit dab88884ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1191,14 +1191,20 @@ void idAFEntity_Gibbable::Gib( const idVec3 &dir, const char *damageDefName ) {
UnlinkCombat();
if ( g_bloodEffects.GetBool() ) {
if ( gameLocal.time > gameLocal.GetGibTime() ) {
// Real Gibs - Taken from the repository (https://github.com/RobertBeckebans/Sikkpin-Feedback)
// sikk - Since "nextGibTime" is a member of idGameLocal and not idAFEntity||idAFEntity_Gibbable
// the folloing if statement is only true once per damage event instead of per entity being damaged.
// This is why only one entity will get gibbed while the rest just disappear after a few seconds.
// I commented this out instead of moving the variable to the proper class because it's easier and
// the delay is only 200ms so the difference should be unnoticable
//if ( gameLocal.time > gameLocal.GetGibTime() ) {
gameLocal.SetGibTime( gameLocal.time + GIB_DELAY );
SpawnGibs( dir, damageDefName );
renderEntity.noShadow = true;
renderEntity.shaderParms[ SHADERPARM_TIME_OF_DEATH ] = gameLocal.time * 0.001f;
StartSound( "snd_gibbed", SND_CHANNEL_ANY, 0, false, NULL );
gibbed = true;
}
//}
} else {
gibbed = true;
}