diff options
Diffstat (limited to 'engines/wage/script.cpp')
-rw-r--r-- | engines/wage/script.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index 60a7e95e36..e1f3c67535 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -160,18 +160,19 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i handleStatusCommand(); } else if (input.contains("rest") || input.equals("wait")) { handleRestCommand(); - /* - } else if (callbacks.getOffer() != NULL && input.contains("accept")) { + } else if (callbacks->getOffer() != NULL && input.contains("accept")) { handleAcceptCommand(); } else { - Chr player = world.getPlayer(); - for (Weapon weapon : player.getWeapons()) { - if (tryAttack(weapon, input)) { - handleAttack(weapon); + Chr *player = _world->_player; + WeaponArray *weapons = player->getWeapons(); + for (WeaponArray::const_iterator weapon = weapons->begin(); weapon != weapons->end(); ++weapon) { + if (tryAttack(*weapon, input)) { + handleAttack(*weapon); break; } } - */ + + delete weapons; } /* // TODO: weapons, offer, etc... @@ -492,4 +493,14 @@ void Script::handleOfferCommand(const char *target) { warning("STUB: handleOfferCommand"); } +bool Script::tryAttack(Weapon *weapon, Common::String &input) { + warning("STUB: tryAttack"); + + return false; +} + +void Script::handleAttack(Weapon *weapon) { + warning("STUB: handleAttack"); +} + } // End of namespace Wage |