mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2024-11-15 00:41:21 +00:00
Fixed potential crash in game DLLs from a monster accidentally shooting a corpse in coop mode.
See here:
4132eed597
This commit is contained in:
parent
2cac9ab01c
commit
53340c1158
3 changed files with 19 additions and 3 deletions
|
@ -670,6 +670,11 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
if (attacker == targ || attacker == targ->enemy)
|
||||
return;
|
||||
|
||||
// apanteleev- dead monsters, like misc_deadsoldier, don't have AI
|
||||
// functions, but M_ReactToDamage might still be called on them
|
||||
if (targ->svflags & SVF_DEADMONSTER)
|
||||
return;
|
||||
|
||||
// if we are a good guy monster and our attacker is a player
|
||||
// or another good guy, do not get mad at them
|
||||
if (targ->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
|
|
|
@ -588,7 +588,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER) && !is_turret &&
|
||||
!(targ->monsterinfo.aiflags & AI_DUCKED) )
|
||||
{
|
||||
if (!targ->movetarget || Q_stricmp(targ->movetarget->classname,"thing") )
|
||||
if (!targ->movetarget || Q_stricmp(targ->movetarget->classname, "thing") )
|
||||
{
|
||||
int i;
|
||||
edict_t *thing;
|
||||
|
@ -748,6 +748,11 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker, edict_t *inflictor)
|
|||
if (attacker == targ || attacker == targ->enemy)
|
||||
return;
|
||||
|
||||
// apanteleev- dead monsters, like misc_deadsoldier, don't have AI
|
||||
// functions, but M_ReactToDamage might still be called on them
|
||||
if (targ->svflags & SVF_DEADMONSTER)
|
||||
return;
|
||||
|
||||
// if we are a good guy monster and our attacker is a player
|
||||
// or another good guy, do not get mad at them
|
||||
if (targ->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
|
|
|
@ -308,13 +308,19 @@ static int CheckArmor (edict_t *ent, vec3_t point, vec3_t normal, int damage, in
|
|||
|
||||
void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
||||
{
|
||||
if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER) &&
|
||||
(strcmp (attacker->classname, "monster_autocannon") != 0))
|
||||
// if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER) &&
|
||||
// (strcmp (attacker->classname, "monster_autocannon") != 0))
|
||||
if ( attacker->classname && !strncmp(attacker->classname, "monster_autocannon", 18) )
|
||||
return;
|
||||
|
||||
if (attacker == targ || attacker == targ->enemy)
|
||||
return;
|
||||
|
||||
// apanteleev- dead monsters, like misc_deadsoldier, don't have AI
|
||||
// functions, but M_ReactToDamage might still be called on them
|
||||
if (targ->svflags & SVF_DEADMONSTER)
|
||||
return;
|
||||
|
||||
// if we are a good guy monster and our attacker is a player
|
||||
// or another good guy, do not get mad at them
|
||||
if (targ->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
|
|
Loading…
Reference in a new issue