This takes out the last of the RenderObject mutables.
This also fixes the long-standing editor bug that map tiles
that are once moved to parallax layers and then back to a
normal layer keep their scroll factor until the tile is deleted
or the map saved and reloaded.
- Lua func node_activate() is now variadic and can pass any params to the target's activate()
- Add Lua func entity_activate() that works in the same manner
- Activating nodes/entities via RMB now passes (naija ptr, int input source) to activate()
- Don't delay entity activation by 1 frame
- Minor cleanups to some Lua functions; no functional changes there
The game used to unconditionally enforce shots to go at close to their max speed;
it is now possible to turn that behavior off if needed:
In a shot txt file, set AlwaysMaxSpeed = 0
New Lua functions:
+ shot_setAlwaysMaxSpeed()
+ shot_isAlwaysMaxSpeed
Like this:
size_t x;
if(is >> x) {...}
This used to return true despite x never being populated, because
is was casted to bool, which is fine to shift by uninitialized, and
likely returned true. Whatever.
Also fix bug that mouse.change got stuck on a tiny value and constantly
move the camera in editor mode.
This is a continuation of 764d106d50 and seems to fix the
previous issues with SDL2 >= 2.0.17
Also remove some unused vars.
This problem might have been introduced in 06270eaac0 but not sure.
The crash could happen due to a use-after-free memory access:
When deleting an entity with skel in postInit(), deletion would be
delayed by 1 frame because that is how entity_delete() works.
During deletion, RenderObject::children were removed and deleted
but SkeletalSprite::bones still had those pointers.
Additionally an object would delete its children in onUpdate() after
safeKill(), and still proceed to run scripts, which would then possibly
access freed memory too.
This fix causes children to not be deleted until we're out of the update()
cycle, and instead delete children together with the root object.