aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-16 11:20:51 -0400
committerPaul Gilbert2018-04-16 11:20:51 -0400
commitcdfe8c89f7671a09a418617d059524b88fff2d4c (patch)
tree27e763d22c59f2f9cf24388575339f2f1e8e1422
parent5cba33c0526120d46b73531328d54d6f88c73201 (diff)
downloadscummvm-rg350-cdfe8c89f7671a09a418617d059524b88fff2d4c.tar.gz
scummvm-rg350-cdfe8c89f7671a09a418617d059524b88fff2d4c.tar.bz2
scummvm-rg350-cdfe8c89f7671a09a418617d059524b88fff2d4c.zip
XEEN: Fix loading Swords blacksmiths
-rw-r--r--engines/xeen/locations.cpp7
-rw-r--r--engines/xeen/locations.h2
-rw-r--r--engines/xeen/scripts.cpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/engines/xeen/locations.cpp b/engines/xeen/locations.cpp
index 00e7c0e762..e2359df69c 100644
--- a/engines/xeen/locations.cpp
+++ b/engines/xeen/locations.cpp
@@ -2240,9 +2240,12 @@ int PyramidLocation::show() {
LocationManager::LocationManager() : _location(nullptr) {
}
-int LocationManager::doAction(LocationAction actionId) {
+int LocationManager::doAction(int actionId) {
+ LocationAction action = (g_vm->getGameID() == GType_Swords && actionId > 13 && actionId < 18) ?
+ BLACKSMITH : (LocationAction)actionId;
+
// Create the desired location
- switch (actionId) {
+ switch (action) {
case BANK:
_location = new Locations::BankLocation();
break;
diff --git a/engines/xeen/locations.h b/engines/xeen/locations.h
index d3b2794732..ad0a8e2cee 100644
--- a/engines/xeen/locations.h
+++ b/engines/xeen/locations.h
@@ -364,7 +364,7 @@ public:
/**
* Show a given location, and return any result
*/
- int doAction(LocationAction actionId);
+ int doAction(int actionId);
/**
* Returns true if a town location (bank, blacksmith, etc.) is currently active
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 81ba0caab9..f126a658a2 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -854,7 +854,7 @@ bool Scripts::cmdSpawn(ParamsIterator &params) {
}
bool Scripts::cmdDoTownEvent(ParamsIterator &params) {
- _scriptResult = _vm->_locations->doAction((LocationAction)params.readByte());
+ _scriptResult = _vm->_locations->doAction(params.readByte());
_vm->_party->_stepped = true;
_refreshIcons = true;