REGoth-project / REGoth

OpenSource-Reimplementation of the zEngine, used by the game "Gothic"
GNU General Public License v3.0
630 stars 63 forks source link

Invalid Item Handle when killing a Goblins/Skeletons after loading a savegame #321

Open markusobi opened 6 years ago

markusobi commented 6 years ago

When killing a goblin/skeleton after loading a savegame the game tries to equip an invalid item. The callstack looked like this: PlayerController::AniEvent_SFX PlayerController::die PlayerController::interrupt PlayerController::undrawWeapon PlayerController::equipItem DaedalusGameState::getItem

The handle PlayerController::m_EquipmentState.activeWeapon of the dying monster is not longer valid, because the internal handle's generation increased by 1.

Might be related to the special case for goblins/skeletons: AFAIK they are in FIST mode, but hold a weapon. It only happens when loading a savegame not - not in a new game!