by edward850 » Sun Dec 28, 2014 8:15 pm
Likely an oversight, it appears that a NoDelay state can accidentally cause an actor to run a function twice in the same tic.
Code: Select all
actor foobar
{
states
{
spawn:
TNT1 A 0 nodelay
BAL1 A 1 A_ChangeVelocity(1,0,0)
wait
}
}
When the actor tics and checks/sets the state in the
state->GetNoDelay() block, it'll run both frames in the above actor and set the tics to 1. However,
it then goes on to run the normal frame counter, and immediately tics back down to 0 and runs A_ChangeVelocity a second time in the same tic.
Something tells me that's not supposed to happen, and the block should return at the end, rather than continuing to the normal frame counter.
Likely an oversight, it appears that a NoDelay state can accidentally cause an actor to run a function twice in the same tic.
[code]actor foobar
{
states
{
spawn:
TNT1 A 0 nodelay
BAL1 A 1 A_ChangeVelocity(1,0,0)
wait
}
}[/code]
When the actor tics and checks/sets the state in the [url=https://github.com/rheit/zdoom/blob/519ff8b7d114b6d38ba0813b8d7f509ef6e6329c/src/p_mobj.cpp#L3639]state->GetNoDelay()[/url] block, it'll run both frames in the above actor and set the tics to 1. However, [url=https://github.com/rheit/zdoom/blob/519ff8b7d114b6d38ba0813b8d7f509ef6e6329c/src/p_mobj.cpp#L3660]it then goes on to run the normal frame counte[/url]r, and immediately tics back down to 0 and runs A_ChangeVelocity a second time in the same tic.
Something tells me that's not supposed to happen, and the block should return at the end, rather than continuing to the normal frame counter.