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.
This also fixes a long-standing off-by-one with the generated ObsRows:
Before this commit, the game would (upon F11) eat every black pixel from
the map template that was directly left of a white pixel, eg.
#### ## # ## ... would become
### # # ...
GENERATED MAPS ARE NOW DIFFERENT!
With this bug gone, dumping obs (F8) and loading that back in as a map
template (F11) should now be fully round-trip compatible and not lose
pixels anymore.
Extra feature:
(R>=200, G in [128..199], B>=200) in the map template now designate zones
that should not be obstructed but also not generate border rocks when
skinned (F12). Makes editing energy temple styled maps much easier since
we don't have to manually erase tiles on layer "5" anymore, all the time.