P_Thing_Raise fixes & cleanup

- Transfer flags directly into the function and process inside instead of the action functions
- Pass in raiser for all function calls
This commit is contained in:
Major Cooke 2018-11-17 10:44:06 -06:00 committed by Christoph Oelckers
commit a8d4d45e89
4 changed files with 17 additions and 21 deletions

View file

@ -432,7 +432,7 @@ void P_RemoveThing(AActor * actor)
}
bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
bool P_Thing_Raise(AActor *thing, AActor *raiser, int flags)
{
if (!thing)
return false;
@ -455,7 +455,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
thing->flags |= MF_SOLID;
thing->Height = info->Height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius
if (!nocheck && !P_CheckPosition (thing, thing->Pos()))
if (!(flags & RF_NOCHECKPOSITION) && !P_CheckPosition (thing, thing->Pos()))
{
thing->flags = oldflags;
thing->radius = oldradius;
@ -470,7 +470,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
thing->Revive();
if (raiser != NULL)
if ((flags & RF_TRANSFERFRIENDLINESS) && raiser != nullptr)
{
// Let's copy the friendliness of the one who raised it.
thing->CopyFriendliness(raiser, false);