- Added AActor::SetFriendPlayer() to make setting FriendPlayer cleaner to read when doing it with

a player_t pointer.

SVN r3681 (trunk)
This commit is contained in:
Randy Heit 2012-06-09 04:15:56 +00:00
commit 086d0a797e
8 changed files with 28 additions and 49 deletions

View file

@ -963,11 +963,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
missile->tracer=self->target;
}
// we must redo the spectral check here because the owner is set after spawning so the FriendPlayer value may be wrong
if (missile->flags4&MF4_SPECTRAL)
if (missile->flags4 & MF4_SPECTRAL)
{
if (missile->target != NULL && missile->target->player != NULL)
if (missile->target != NULL)
{
missile->FriendPlayer = int(missile->target->player - players) + 1;
missile->SetFriendPlayer(missile->target->player);
}
else
{
@ -1737,8 +1737,8 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
else if (originator->player)
{
// A player always spawns a monster friendly to him
mo->flags|=MF_FRIENDLY;
mo->FriendPlayer = int(originator->player-players+1);
mo->flags |= MF_FRIENDLY;
mo->SetFriendPlayer(originator->player);
AActor * attacker=originator->player->attacker;
if (attacker)