mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
fix bug in command code, letting a failed command being executed
svn-id: r11452
This commit is contained in:
parent
57efe0438f
commit
03e70632b2
@ -263,9 +263,15 @@ void Command::executeCurrentAction(bool walk) {
|
|||||||
if (_selCmd.action.value() == VERB_LOOK_AT) {
|
if (_selCmd.action.value() == VERB_LOOK_AT) {
|
||||||
// Look At, do standard look at routine
|
// Look At, do standard look at routine
|
||||||
look();
|
look();
|
||||||
cleanupCurrentAction();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (com->song < 0) {
|
||||||
|
_sound->playSong(-com->song);
|
||||||
|
}
|
||||||
|
clear(true);
|
||||||
|
}
|
||||||
|
cleanupCurrentAction();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (cond == -2 && i == comMax) {
|
else if (cond == -2 && i == comMax) {
|
||||||
// only exit on a condition fail if at last command
|
// only exit on a condition fail if at last command
|
||||||
@ -424,7 +430,7 @@ void Command::executeCurrentAction(bool walk) {
|
|||||||
|
|
||||||
// only play song if it's a PLAY AFTER type
|
// only play song if it's a PLAY AFTER type
|
||||||
if (com->song < 0) {
|
if (com->song < 0) {
|
||||||
_sound->playSong(com->song);
|
_sound->playSong(-com->song);
|
||||||
}
|
}
|
||||||
|
|
||||||
clear(true);
|
clear(true);
|
||||||
|
@ -400,7 +400,7 @@ void Logic::initialise() {
|
|||||||
|
|
||||||
|
|
||||||
ObjectData* Logic::objectData(int index) {
|
ObjectData* Logic::objectData(int index) {
|
||||||
index = abs(index);
|
index = abs(index); // cyx: is that really necessary ?
|
||||||
if (index <= _numObjects)
|
if (index <= _numObjects)
|
||||||
return &_objectData[index];
|
return &_objectData[index];
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user