mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
ec871e6bf7
simulation The purpose of weak_ptr is to avoid performing the simulation on deleted Actor by promoting it to a shared_ptr via a lock() call. This clutter the code with a lot of branches, whereas the overwhelmingly common case is for the call to succeed. Since the simulation is decoupled from the engine state, we can use a shared_ptr instead of a weak_ptr. This allow us to ignore (ie not handle) the rarer case where the actor is delete from the scene. This means that the simulation will run for one frame more than before for each actor, whereas the rest of the engine will be ignorant of this.