pause/resume need to treat things a bit differently from the normal setRate function. This caused a jump in a timer when resuming from the pause menu in certain cases, though not all the time.
Regression from b50cac637e, which was part of the fix for the lid animations.
The method it is meant to override uses "const byte *buf" so this
one should too. I don't know if/when it's called, but fuzzie tells
me it should be a harmless change. Hopefully fixes CID 1003892.
I think this is the correct thing to do, and that it won't have
any noticeable effect whatsoever.
Cases 29 and 30 happen in the first half of the game, in the
cantine, while case 42 happens in the second half of the game. By
the time you reach the point where case 42 does something, I don't
think it's possible to get back to cases 29 and 30, so when case
29 falls through neither 30 nor 42 will do anything.
CID 1003730, 1003731
The mof instruction needs to return 0 or 1 to continue execution, rather
than 2 which indicates to end table instruction execution. Using 0 as
this is most likely correct value.
This would happen in Ringworld when clicking on the slot in the
flycycle. I have compared the behaviour to the original, and I
can't see any obvious differences after my change. CID 1003728
Uses the fact that 4*480*480 == 225 << 12, and the identity
(a*b)>>n == (a>>n)*b + ((a%(1<<n))*b)>>n (assuming non-overflowing math),
except the rhs uses smaller intermediate values and does not overflow(*).
Compared to the original code, this uses 1 fewer division and eliminates
the rounding error.
(*) Technical note: In some cases the right hand side of the above
identity still has possibilities of intermediate overflow, but only if
b > (1 << n), or if (b << n) overflows, neither of which are true here.
This is a regression from 6e4217e1ba.
setResult does not automatically close the dialog. However,
Dialog::handleCommand will close the dialog when kCloseCmd is received.
This ensures that if any unhandled/invalid instructions are present,
they are skipped, rather than locking up engine execution.
This is a secondary fix for bug #3614697 - "Spanish version
uncompletable at end of 2nd part" and any other future bugs of this
type.
This add support for the unhandled "mof" instruction present in the
Spanish version. This effectively skips it as a NOP/invalid, which
prevents it locking up the game at the end of the 2nd part.