diff options
author | Nipun Garg | 2019-07-14 00:48:58 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:19 +0200 |
commit | cea99e3fcd8621b01fe089e65c9403e6365aa39a (patch) | |
tree | 101210ec0605b48aec9708244c07c59a124ea191 | |
parent | de7b30a23cdb90e0ed6e7c1373800f98df675cf1 (diff) | |
download | scummvm-rg350-cea99e3fcd8621b01fe089e65c9403e6365aa39a.tar.gz scummvm-rg350-cea99e3fcd8621b01fe089e65c9403e6365aa39a.tar.bz2 scummvm-rg350-cea99e3fcd8621b01fe089e65c9403e6365aa39a.zip |
HDB: Unstub Weapon code from save/load
-rw-r--r-- | engines/hdb/ai-init.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 64de429d72..dadca18d25 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -1264,7 +1264,7 @@ void AI::save(Common::OutSaveFile *out) { out->writeByte(_playerOnIce); out->writeByte(_playerEmerging); out->writeByte(_playerRunning); - warning("STUB: Save whether weapon is selected"); + out->writeSint32LE((int)_weaponSelected); // Save Teleporters for (i = 0; i < kMaxTeleporters; i++) { @@ -1454,7 +1454,7 @@ void AI::loadSaveFile(Common::InSaveFile *in) { _playerOnIce = in->readByte(); _playerEmerging = in->readByte(); _playerRunning = in->readByte(); - warning("STUB: Load whether weapon is selected or not"); + _weaponSelected = (AIType)in->readSint32LE(); // Load Teleporters for (i = 0; i < kMaxTeleporters; i++) { @@ -1698,7 +1698,13 @@ void AI::loadSaveFile(Common::InSaveFile *in) { initAnimInfo(); // Set the Player weapon - warning("STUB: Set the Player weapon"); + if (_weaponSelected != AI_NONE) { + int slot = queryInventoryTypeSlot(_weaponSelected); + if (slot != -1) { + Tile *gfx = getInvItemGfx(slot); + setPlayerWeapon(_weaponSelected, gfx); + } + } } void AI::initAnimInfo() { |