mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-18 10:11:11 +00:00
- Fixed: Monsters should never target friends, even if the friendliness
state has changed since the target has been acquired. - Fixed: Multiplayer telefrag obituaries must be handled before weapon dependent obituary messages. SVN r341 (trunk)
This commit is contained in:
parent
6c3b569e66
commit
a3f39c3789
4 changed files with 66 additions and 28 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
September 27, 2006 (Changes by Graf Zahl)
|
||||||
|
- Fixed: Monsters should never target friends, even if the friendliness
|
||||||
|
state has changed since the target has been acquired.
|
||||||
|
- Fixed: Multiplayer telefrag obituaries must be handled before weapon
|
||||||
|
dependent obituary messages.
|
||||||
|
|
||||||
September 26, 2006
|
September 26, 2006
|
||||||
- PClass::StaticInit() now sorts the class metadata so that operations that
|
- PClass::StaticInit() now sorts the class metadata so that operations that
|
||||||
iterate over it (such as the "give all" cheat) are compiler-independant.
|
iterate over it (such as the "give all" cheat) are compiler-independant.
|
||||||
|
|
|
@ -241,6 +241,14 @@ void A_VileChase (AActor *self)
|
||||||
temp = self->target;
|
temp = self->target;
|
||||||
self->target = corpsehit;
|
self->target = corpsehit;
|
||||||
A_FaceTarget (self);
|
A_FaceTarget (self);
|
||||||
|
if (self->flags & MF_FRIENDLY)
|
||||||
|
{
|
||||||
|
// If this is a friendly Arch-Vile (which is turning the resurrected monster into its friend)
|
||||||
|
// and the Arch-Vile is currently targetting the resurrected monster the target must be cleared.
|
||||||
|
if (self->lastenemy == temp) self->lastenemy = NULL;
|
||||||
|
if (temp == self->target) temp = NULL;
|
||||||
|
|
||||||
|
}
|
||||||
self->target = temp;
|
self->target = temp;
|
||||||
|
|
||||||
// Make the state the monster enters customizable - but leave the
|
// Make the state the monster enters customizable - but leave the
|
||||||
|
|
|
@ -1210,9 +1210,16 @@ bool P_LookForTID (AActor *actor, INTBOOL allaround)
|
||||||
// Use last known enemy if no hatee sighted -- killough 2/15/98:
|
// Use last known enemy if no hatee sighted -- killough 2/15/98:
|
||||||
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
||||||
{
|
{
|
||||||
actor->target = actor->lastenemy;
|
if (!actor->IsFriend(actor->lastenemy))
|
||||||
actor->lastenemy = NULL;
|
{
|
||||||
return true;
|
actor->target = actor->lastenemy;
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1351,12 +1358,19 @@ bool P_LookForEnemies (AActor *actor, INTBOOL allaround)
|
||||||
actor->target = actor->goal;
|
actor->target = actor->goal;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Use last known enemy if no enemies sighted -- killough 2/15/98:
|
// Use last known enemy if no hatee sighted -- killough 2/15/98:
|
||||||
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
||||||
{
|
{
|
||||||
actor->target = actor->lastenemy;
|
if (!actor->IsFriend(actor->lastenemy))
|
||||||
actor->lastenemy = NULL;
|
{
|
||||||
return true;
|
actor->target = actor->lastenemy;
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1437,12 +1451,19 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
|
||||||
actor->target = actor->goal;
|
actor->target = actor->goal;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Use last known enemy if no players sighted -- killough 2/15/98:
|
// Use last known enemy if no hatee sighted -- killough 2/15/98:
|
||||||
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
if (actor->lastenemy != NULL && actor->lastenemy->health > 0)
|
||||||
{
|
{
|
||||||
actor->target = actor->lastenemy;
|
if (!actor->IsFriend(actor->lastenemy))
|
||||||
actor->lastenemy = NULL;
|
{
|
||||||
return true;
|
actor->target = actor->lastenemy;
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
actor->lastenemy = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return actor->target == actor->goal && actor->goal != NULL;
|
return actor->target == actor->goal && actor->goal != NULL;
|
||||||
|
@ -1799,8 +1820,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [RH] If the target is dead (and not a goal), stop chasing it.
|
// [RH] If the target is dead or a friend (and not a goal), stop chasing it.
|
||||||
if (actor->target && actor->target != actor->goal && actor->target->health <= 0)
|
if (actor->target && actor->target != actor->goal && (actor->target->health <= 0 || actor->IsFriend(actor->target)))
|
||||||
actor->target = NULL;
|
actor->target = NULL;
|
||||||
|
|
||||||
// [RH] Friendly monsters will consider chasing whoever hurts a player if they
|
// [RH] Friendly monsters will consider chasing whoever hurts a player if they
|
||||||
|
|
|
@ -273,25 +273,28 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (inflictor != NULL)
|
if (mod == MOD_TELEFRAG) message = GStrings("OB_MPTELEFRAG");
|
||||||
{
|
|
||||||
message = inflictor->GetClass()->Meta.GetMetaString (AMETA_Obituary);
|
|
||||||
}
|
|
||||||
if (message == NULL && attacker->player->ReadyWeapon != NULL)
|
|
||||||
{
|
|
||||||
message = attacker->player->ReadyWeapon->GetClass()->Meta.GetMetaString (AMETA_Obituary);
|
|
||||||
}
|
|
||||||
if (message == NULL)
|
if (message == NULL)
|
||||||
{
|
{
|
||||||
switch (mod)
|
if (inflictor != NULL)
|
||||||
{
|
{
|
||||||
case MOD_R_SPLASH: messagename = "OB_MPR_SPLASH"; break;
|
message = inflictor->GetClass()->Meta.GetMetaString (AMETA_Obituary);
|
||||||
case MOD_BFG_SPLASH: messagename = "OB_MPBFG_SPLASH"; break;
|
}
|
||||||
case MOD_TELEFRAG: messagename = "OB_MPTELEFRAG"; break;
|
if (message == NULL && attacker->player->ReadyWeapon != NULL)
|
||||||
case MOD_RAILGUN: messagename = "OB_RAILGUN"; break;
|
{
|
||||||
|
message = attacker->player->ReadyWeapon->GetClass()->Meta.GetMetaString (AMETA_Obituary);
|
||||||
|
}
|
||||||
|
if (message == NULL)
|
||||||
|
{
|
||||||
|
switch (mod)
|
||||||
|
{
|
||||||
|
case MOD_R_SPLASH: messagename = "OB_MPR_SPLASH"; break;
|
||||||
|
case MOD_BFG_SPLASH: messagename = "OB_MPBFG_SPLASH"; break;
|
||||||
|
case MOD_RAILGUN: messagename = "OB_RAILGUN"; break;
|
||||||
|
}
|
||||||
|
if (messagename != NULL)
|
||||||
|
message = GStrings(messagename);
|
||||||
}
|
}
|
||||||
if (messagename != NULL)
|
|
||||||
message = GStrings(messagename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue