Project

General

Profile

Bug #2326

After a bound item expires the last equipped item of that type is not automatically re-equipped

Added by Sergey "Shnatsel" Davidoff about 3 years ago. Updated about 1 month ago.

Status:
In Progress
Priority:
Normal
Category:
Game Mechanics
Target version:
Start date:
01/30/2015
% Done:

90%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

In vanilla Morrowind when a "Bound weapon" effect expires, the last weapon equipped before the effect started is automatically re-equipped. This behavior is also documented in the in-game description of "Bound weapon" effect.

In OpenMW v0.34 this is not the case. When the "Bound weapon" effect wears off PC switches to "Unarmed" instead of the last used weapon.


Related issues

Duplicated by OpenMW - Feature #2950: Previously equipped item should be equiped anew when summoned one disappear Rejected 09/29/2015
Duplicated by OpenMW - Bug #4337: Shoes do not re-equip after Bound Boots spell expires Rejected 03/04/2018

History

#1 Updated by scrawl . over 2 years ago

  • Duplicated by Feature #2950: Previously equipped item should be equiped anew when summoned one disappear added

#2 Updated by Marc Zinnschlag over 1 year ago

  • Category set to Game Mechanics
  • Target version set to openmw-0.42

#3 Updated by Marc Zinnschlag about 1 year ago

  • Target version changed from openmw-0.42 to openmw-0.43

#4 Updated by Andrei Kortunov 12 months ago

Not only weapons, but armor too. It seems Morrowind stores list of previously equipped items in savegame, and re-equip them when spell expires, even if another items are already equipped.
Note: Morrowind stores only last equipped item in slot, even if this item is an another bound weapon and its spell is already expired. In this case Morrowind keeps already equipped item in slot.

#5 Updated by Andrei Kortunov 12 months ago

But I am not sure about NPC and creatures.
Should we store list of bound items for every actor, or can we just run equipment-choice function when the spell expires?
In the latter case we can just store data only for player.

#6 Updated by Alexei Dobrohotov 8 months ago

  • Subject changed from After a bound weapon expires the last used weapon is not automatically re-equipped to After a bound item expires the last equipped item of that type is not automatically re-equipped
  • Status changed from New to Confirmed
  • Operating system changed from Linux to Other

#7 Updated by Alexei Dobrohotov 7 months ago

  • Target version changed from openmw-0.43 to openmw-1.0

#8 Updated by Andrei Kortunov 5 months ago

Note: Morrowind does not store a string RefId, instead it stores a reference to equipped instance of item.

#9 Updated by Andrei Kortunov 5 months ago

A testing code: https://github.com/akortunov/openmw/tree/boundequip

Known issues:
1. I am not sure if storing a MWWorld::Ptr is safe, so I have to store refId of previous items instead if instance ID.
2. We should store previous items in the savegame somehow.
3. MWWorld::ContainerStore::search() behaves a bit strange: it returns the first found record with the specified ID, even if this record is old and has count = 0 (when item was removed).
It is a bug or a feature?

#10 Updated by scrawl . 5 months ago

I am not sure if storing a MWWorld::Ptr is safe

It is safe, but you can't store an MWWorld::Ptr in the save game.

Why not save it like InventoryStore::mSelectedEnchantItem?

3. MWWorld::ContainerStore::search() behaves a bit strange: it returns the first found record with the specified ID, even if this record is old and has count = 0 (when item was removed).
It is a bug or a feature?

Sounds like a bug. I can't think of a reason to search for a deleted item. But you can look at all uses of that function to make sure.

#11 Updated by Andrei Kortunov 5 months ago

Why not save it like InventoryStore::mSelectedEnchantItem?

Do you mean the ContainerStoreIterator? It works mostly fine, until previous item is not removed from player's inventory.
The "iterator == actor.getClass().getInventoryStore(actor).end()" check does not work.

#12 Updated by Andrei Kortunov 5 months ago

So if I do this:
1. Get the ContainerStoreIterator of current weapon
2. Drop the current weapon

Is the iterator still valid in this case? How can I check if the item was removed?

#13 Updated by Andrei Kortunov 4 months ago

  • Status changed from Confirmed to In Progress
  • Assignee set to Andrei Kortunov
  • Target version changed from openmw-1.0 to openmw-0.44
  • % Done changed from 0 to 40

#14 Updated by Andrei Kortunov about 2 months ago

  • Duplicated by Bug #4337: Shoes do not re-equip after Bound Boots spell expires added

#15 Updated by Andrei Kortunov about 1 month ago

  • % Done changed from 40 to 90

#16 Updated by Andrei Kortunov about 1 month ago

Note: we still do not store previous item in the savegame (to keep savegame compatibility). It will be likely added only after next release.

Also available in: Atom PDF