mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-30 03:32:58 +00:00
Calculate thing state only once
This commit is contained in:
parent
d7c80af490
commit
f03d9f6dec
1 changed files with 7 additions and 7 deletions
14
src/p_spec.c
14
src/p_spec.c
|
|
@ -3165,21 +3165,21 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
|||
case 425: // Calls P_SetMobjState on calling mobj
|
||||
{
|
||||
mobj_t *targetThing = NULL;
|
||||
statenum_t state = stringargs[0] ? get_number(stringargs[0]) : S_NULL;
|
||||
|
||||
if (state < 0 || state >= NUMSTATES)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
P_SetMobjState(targetThing, state);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue