mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 12:32:34 +00:00
Backport RETURNTID and FORCETID flags for PickActor from GLOOME. Renamed prefix to avoid confusion with Pain Attack flags. Fixed broken enum.
This commit is contained in:
parent
a8ac748123
commit
2612fad326
1 changed files with 18 additions and 5 deletions
|
@ -133,6 +133,16 @@ enum
|
|||
ARMORINFO_ACTUALSAVEAMOUNT,
|
||||
};
|
||||
|
||||
// PickActor
|
||||
// [JP] I've renamed these flags to something else to avoid confusion with the other PAF_ flags
|
||||
enum
|
||||
{
|
||||
// PAF_FORCETID,
|
||||
// PAF_RETURNTID
|
||||
PICKAF_FORCETID = 1,
|
||||
PICKAF_RETURNTID = 2,
|
||||
};
|
||||
|
||||
struct CallReturn
|
||||
{
|
||||
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
|
||||
|
@ -5779,11 +5789,10 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
wallMask = args[6];
|
||||
}
|
||||
|
||||
bool forceTID = 0;
|
||||
int flags = 0;
|
||||
if (argCount >= 8)
|
||||
{
|
||||
if (args[7] != 0)
|
||||
forceTID = 1;
|
||||
flags = args[7];
|
||||
}
|
||||
|
||||
AActor* pickedActor = P_LinePickActor(actor, args[1] << 16, args[3], args[2] << 16, actorMask, wallMask);
|
||||
|
@ -5791,15 +5800,19 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!(forceTID) && (args[4] == 0) && (pickedActor->tid == 0))
|
||||
if (!(flags & PICKAF_FORCETID) && (args[4] == 0) && (pickedActor->tid == 0))
|
||||
return 0;
|
||||
|
||||
if ((pickedActor->tid == 0) || (forceTID))
|
||||
if ((pickedActor->tid == 0) || (flags & PICKAF_FORCETID))
|
||||
{
|
||||
pickedActor->RemoveFromHash();
|
||||
pickedActor->tid = args[4];
|
||||
pickedActor->AddToHash();
|
||||
}
|
||||
if (flags & PICKAF_RETURNTID)
|
||||
{
|
||||
return pickedActor->tid;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue