aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-29 22:52:48 +0000
committerMartin Kiewitz2010-07-29 22:52:48 +0000
commit2c9d30290e1bdeef0407dc8061c7a9ca3abb9542 (patch)
tree0190c48dc7b8c2ba901ee6efea39ff4a8210f5be /engines
parentdf9f4b5bfeee75319440cab3b2cd54a6ed1ef8f8 (diff)
downloadscummvm-rg350-2c9d30290e1bdeef0407dc8061c7a9ca3abb9542.tar.gz
scummvm-rg350-2c9d30290e1bdeef0407dc8061c7a9ca3abb9542.tar.bz2
scummvm-rg350-2c9d30290e1bdeef0407dc8061c7a9ca3abb9542.zip
SCI: fixing hoyle 3
hoyle 3 is using kCanBeHere, but it has cantBeHere and canBeHere selectors so our auto detection would fail it also has a cantBeHere stub in Actor, thus it won't set acc at all. We reset acc because of that before calling cantBeHere selector (!) of the actors (canBeHere isnt used) so that we wont get a collision otherwise because acc is non zero when calling kDoBresen (fixes all sorts of bugs, clone2727 should clean it up :P svn-id: r51485
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp7
-rw-r--r--engines/sci/engine/kmovement.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 9c5997f4ee..d76199c794 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -716,8 +716,11 @@ void Kernel::setDefaultKernelNames(GameFeatures *features) {
_kernelNames = Common::StringArray(s_defaultKernelNames, ARRAYSIZE(s_defaultKernelNames));
// Some (later) SCI versions replaced CanBeHere by CantBeHere
- if (_selectorCache.cantBeHere != -1)
- _kernelNames[0x4d] = "CantBeHere";
+ if (_selectorCache.cantBeHere != -1) {
+ // hoyle 3 has cantBeHere selector but is assuming to call kCanBeHere
+ if (g_sci->getGameId() != GID_HOYLE3)
+ _kernelNames[0x4d] = "CantBeHere";
+ }
switch (getSciVersion()) {
case SCI_VERSION_0_EARLY:
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 95654ce90f..114b6eb755 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -328,9 +328,10 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
bool collision = false;
reg_t cantBeHere = NULL_REG;
- // FIXME here -> cantBeHere detection doesn't work in hoyle 3
- // it's using kCanBeHere but it just has a selector called cantBeHere, so this here doesn't work
if (SELECTOR(cantBeHere) != -1) {
+ // adding this here for hoyle 3 to get happy. CantBeHere is a dummy in hoyle 3 and acc is != 0 so we would
+ // get a collision otherwise
+ s->r_acc = NULL_REG;
invokeSelector(s, client, SELECTOR(cantBeHere), argc, argv);
if (!s->r_acc.isNull())
collision = true;
@@ -357,8 +358,6 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
if (completed)
invokeSelector(s, mover, SELECTOR(moveDone), argc, argv);
- // FIXME here -> cantBeHere detection doesn't work in hoyle 3
- // it's using kCanBeHere but it just has a selector called cantBeHere, so this here doesn't work
if (SELECTOR(cantBeHere) != -1)
return cantBeHere;
return make_reg(0, completed);