AGI: Add detection+workaround for endofloop+motion at the same time

Detects when end.of.loop + motions are used on the same screen
object at the same time, which would have resulted in flag
corruption in the original interpreter. We detect this
situation now, show a warning and disable the cycler in case
cycler was activated first.
This solves a new issue in kq1, when grabbing the eagle in room
22, that was previously hidden just like in the original AGI.
Fixes bug #7046
This commit is contained in:
Martin Kiewitz 2016-02-19 10:34:37 +01:00
parent 1c4778d571
commit 5484f0bc58
3 changed files with 65 additions and 0 deletions

View file

@ -1495,6 +1495,8 @@ void cmdReverseLoop(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
screenObj->loop_flag = loopFlag;
state->_vm->setFlag(screenObj->loop_flag, false);
vm->cyclerActivated(screenObj);
}
void cmdReverseLoopV1(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
@ -1520,6 +1522,8 @@ void cmdEndOfLoop(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
screenObj->flags |= (fDontupdate | fUpdate | fCycling);
screenObj->loop_flag = loopFlag;
vm->setFlag(screenObj->loop_flag, false);
vm->cyclerActivated(screenObj);
}
void cmdEndOfLoopV1(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
@ -1632,6 +1636,8 @@ void cmdFollowEgo(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
vm->setFlag(screenObj->follow_flag, false);
screenObj->flags |= fUpdate;
}
vm->motionActivated(screenObj);
}
void cmdMoveObj(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
@ -1660,6 +1666,8 @@ void cmdMoveObj(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
screenObj->flags |= fUpdate;
}
vm->motionActivated(screenObj);
if (objectNr == 0)
state->playerControl = false;
@ -1688,6 +1696,8 @@ void cmdMoveObjF(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
vm->setFlag(screenObj->move_flag, false);
screenObj->flags |= fUpdate;
vm->motionActivated(screenObj);
if (objectNr == 0)
state->playerControl = false;
@ -1709,6 +1719,8 @@ void cmdWander(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
} else {
screenObj->flags |= fUpdate;
}
vm->motionActivated(screenObj);
}
void cmdSetGameID(AgiGame *state, AgiEngine *vm, uint8 *parameter) {