mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
AGS: Fixup character's view loop in update, prevent having no frame
From upstream 2ac1b258db203b62ba0613c979d7a092b51e441f
This commit is contained in:
@@ -76,10 +76,15 @@ void CharacterInfo::UpdateMoveAndAnim(int &char_index, CharacterExtras *chex, in
|
||||
return; // must be careful not to screw things up
|
||||
}
|
||||
|
||||
// Make sure it doesn't flash up a blue cup
|
||||
if (view < 0);
|
||||
else if (loop >= _G(views)[view].numLoops)
|
||||
loop = 0;
|
||||
// Fixup character's view when possible
|
||||
if (view >= 0 &&
|
||||
(loop >= _G(views)[view].numLoops || frame >= _G(views)[view].loops[loop].numFrames)) {
|
||||
for (loop = 0;
|
||||
(loop < _G(views)[view].numLoops) && (_G(views)[view].loops[loop].numFrames == 0); ++loop) {
|
||||
}
|
||||
if (loop == _G(views)[view].numLoops)
|
||||
quitprintf("!Character %s is assigned view %d that has no frames!", name, view);
|
||||
}
|
||||
|
||||
int doing_nothing = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user