The previous logic was meant to prevent packet spam from local scripts, but inadvertently prevented objects from being enabled or disabled correctly from dialogue in certain quests.
Enabling and disabling objects from dialogue and the console is now always allowed to go through.
Instead of registering the desired change of position and rely on
physics simulation to apply it to the world, immediately change the
position in the world without reset the simulation.
When a script calls SetPos for x,y,z in sequence on an actor, we need to make sure
that the actor will not spawn under ground at x,y coordinates.
Now that change of coordinates are cumulated and applied all at once, we
need to account for the whole offset.
To this end move the terrain height check inside of Actor class.
its current position.
Use it in relevant MWScripts opcode (move and moveworld).
Remove the fragile detection of scripted translation from PhysicsTaskScheduler.
No user visible change, just a more robust mechanism.
Before this change, if an actor position was changed while the physics
simulation was running, the simulation result would be discarded. It is
fine in case of one off event such as teleport, but in the case of
scripts making use of this functionality to make lifts or conveyor (such
as Sotha Sil Expanded mod) it broke actor movement.
To alleviate this issue, at the end of the simulation, the position of the Actor
in the world is compared to the position it had at the beginning of the
simulation. A difference indicate a force move occured. In this case,
the Actor mPosition and mPreviousPosition are translated by the difference of position.
Since the Actor position will be really set while the next simulation runs, we
save it in the mNextPosition field.
setPosition(getPosition() + diff) to move actor in scripts.
With background physics, this is very slightly off with the collision
object position.
When the script run long enough (a few dozen frames for instance),
the accumulated error becomes too big. It make actors fall through lifts floors.
Container base record mutations
See merge request OpenMW/openmw!353
(cherry picked from commit 8b33765dd414680f0074b3e115b52b291b4cb7cb)
275908a0 mutate container base records
16fca11d add changelog entry