Skip to content

Treat teleportation out of the draft cell as object creation

Evil Eye requested to merge Assumeru/openmw:draft into master

Fixes #7453 (closed) and #7588 (closed). Alternative to !3420 (closed) because this is easier to refer to than something that lives in my head.

This fixes the issue of a moved Levelled List not respawning by using forEachType, it also incorporates @ptmikheev's original commit to fix the spawned creature's location. Besides that it makes teleporting an object out of the draft cell behave as though the object was created in the target cell, which avoids the need to track moved instances for objects that are only ever "teleported" once. Further teleports will of course still be tracked as moved refs. I also copied the documentation change, but tweaked it slightly to avoid the term restocking which usually refers to negative item counts.

The goal of not treating these instances as moved refs is to reduce minor save game bloat, to treat the draft cell as an implementation detail instead of a real cell, and to make them behave like other newly spawned instances.

Also changes the setPtr call introduced in !3411 (merged) to the object's inventory as opposed to the inventory containing the object. Which I'm pretty sure was the intent, but was something I overlooked during review.

And it makes cell:getAll(type.LevelledCreature) work because I forgot to implement it when adding the type and it was convenient to have here.

Edited by Evil Eye

Merge request reports