tsm decay: try to work around some more removal bugs
This commit is contained in:
parent
6214de366b
commit
7915ec8bc1
|
@ -156,6 +156,8 @@ namespace BizHawk.Client.Common
|
|||
backwardFrame = currentFrame;
|
||||
}
|
||||
}
|
||||
|
||||
int decayStatesLast = decayStates;
|
||||
|
||||
if (forwardFrame > -1 && backwardFrame > -1)
|
||||
{
|
||||
|
@ -192,10 +194,11 @@ namespace BizHawk.Client.Common
|
|||
decayStates--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// we're very sorry about failing to find states to remove, but we can't go beyond capacity, so remove at least something
|
||||
// this shouldn't happen, but if we don't do it here, nothing good will happen either
|
||||
if (decayStatesLast == decayStates)
|
||||
{
|
||||
if (_tsm.RemoveState(_tsm.GetStateFrameByIndex(1)))
|
||||
{
|
||||
// decrementing this if no state was removed is BAD
|
||||
|
|
Loading…
Reference in New Issue