forked from mirror/openmw-tes3mp
Only update the icon if player is NOT unarmed, to avoid bad dereference.
This commit is contained in:
parent
bcacdc49af
commit
e695890e01
1 changed files with 4 additions and 1 deletions
|
@ -307,7 +307,10 @@ void MWState::StateManager::loadGame (const Character *character, const Slot *sl
|
||||||
|
|
||||||
//Update the weapon icon in the hud with whatever the player is currently holding.
|
//Update the weapon icon in the hud with whatever the player is currently holding.
|
||||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight));
|
MWWorld::ContainerStoreIterator item = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
|
|
||||||
|
if (item != invStore.end())
|
||||||
|
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*item);
|
||||||
|
|
||||||
ESM::CellId cellId = ptr.getCell()->getCell()->getCellId();
|
ESM::CellId cellId = ptr.getCell()->getCell()->getCellId();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue