- Lets try fixing the extra tic issue by evaluating the zero delay states at PostBeginPlay. This requires delaying the state cycling until the next tick.

SVN r4234 (trunk)
This commit is contained in:
Braden Obrzut 2013-04-29 21:12:57 +00:00
parent 90b4480bcd
commit 10934f4d70

View file

@ -3498,14 +3498,6 @@ void AActor::Tick ()
// cycle through states, calling action functions at transitions
if (tics != -1)
{
// you can cycle through multiple states in a tic
// [BL] If we reach here with a 0 duration state, we
// have created an extra tic, so account for it.
int newtics;
do
{
newtics = --tics;
// [RH] Use tics <= 0 instead of == 0 so that spawnstates
// of 0 tics work as expected.
if (tics <= 0)
@ -3519,8 +3511,8 @@ void AActor::Tick ()
if (!SetState (state->GetNextState()))
return; // freed itself
}
}
while (newtics < 0 && tics != -1);
tics--;
}
else
{
@ -3991,6 +3983,13 @@ void AActor::PostBeginPlay ()
Renderer->StateChanged(this);
}
PrevAngle = angle;
// [BL] Run zero-delay spawn states now so that we don't create a tic later
if(tics == 0 && state)
{
if (!SetState (state->GetNextState()))
return; // freed itself
}
}
void AActor::MarkPrecacheSounds() const