Extend Thing_SetState

Second argument is now TID. Leaving it as 0 will still use the activator.
This commit is contained in:
Sally Coolatta 2023-03-10 01:11:38 -05:00
parent 9f4c080964
commit 730d9a0a5b

View file

@ -3163,11 +3163,24 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
break;
case 425: // Calls P_SetMobjState on calling mobj
if (mo && !mo->player)
{
statenum_t state = stringargs[0] ? get_number(stringargs[0]) : S_NULL;
if (state >= 0 && state < NUMSTATES)
P_SetMobjState(mo, state);
mobj_t *targetThing = NULL;
while ((targetThing = P_FindMobjFromTID(args[1], targetThing, mo)) != NULL)
{
statenum_t state = S_NULL;
if (targetThing->player != NULL)
{
continue;
}
state = stringargs[0] ? get_number(stringargs[0]) : S_NULL;
if (state >= 0 && state < NUMSTATES)
{
P_SetMobjState(targetThing, state);
}
}
}
break;