XEEN: Fix loading Swords blacksmiths

This commit is contained in:
Paul Gilbert 2018-04-16 11:20:51 -04:00
parent 5cba33c052
commit cdfe8c89f7
3 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;