mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
SVN r146 (trunk)
This commit is contained in:
parent
90b5130db0
commit
5abd6b972c
2 changed files with 20 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
May 26, 2006 (Changes by Graf Zahl)
|
||||
- Fixed: CallStateChain relied on CallingState being preserved across the
|
||||
call of the state's action function. This is not the case when a missile
|
||||
is being spawned and exploded right away.
|
||||
|
||||
May 25, 2006
|
||||
- Fixed: The C code in AltSoundRenderer::CopyAndClip() did not shift the sample
|
||||
data enough (2 bits instead of 8), so it was super loud and aliased.
|
||||
|
|
|
@ -107,13 +107,12 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState * State)
|
|||
bool result = false;
|
||||
int counter = 0;
|
||||
|
||||
StateCall.State = State;
|
||||
while (StateCall.State != NULL)
|
||||
while (State != NULL)
|
||||
{
|
||||
// Assume success. The code pointer will set this to false if necessary
|
||||
StateCall.Result = true;
|
||||
CallingState = StateCall.State;
|
||||
StateCall.State->GetAction() (actor);
|
||||
CallingState = StateCall.State = State;
|
||||
State->GetAction() (actor);
|
||||
|
||||
// collect all the results. Even one successful call signifies overall success.
|
||||
result |= StateCall.Result;
|
||||
|
@ -122,16 +121,25 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState * State)
|
|||
counter++;
|
||||
if (counter >= 10000) break;
|
||||
|
||||
if (StateCall.State == CallingState)
|
||||
if (StateCall.State == State)
|
||||
{
|
||||
// Abort immediately if the state jumps to itself!
|
||||
if (StateCall.State == StateCall.State->GetNextState()) return false;
|
||||
if (State == State->GetNextState())
|
||||
{
|
||||
StateCall.State = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If both variables are still the same there was no jump
|
||||
// so we must advance to the next state.
|
||||
StateCall.State = StateCall.State->GetNextState();
|
||||
State = State->GetNextState();
|
||||
}
|
||||
else
|
||||
{
|
||||
State = StateCall.State;
|
||||
}
|
||||
}
|
||||
StateCall.State = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue