This fixes Character.AddWaypoint not applying room<->mask resolution conversion,
which result in character's speed being different if room has non 1:1 mask resolution.
Hide calculate_move_stage() inside pathfinder, and expose add_waypoint_direct()
in the pathfinder interface instead.
From upstream 093354d78849dc3b4f13a244d4400c4e71f7d687
These variables had to be set using set_route_move_speed() call in order for
the find_route() and calculate_move_stage() work properly.
But it's not obvious, and easy to forget. So turn them into function arguments instead.
This fixes Character.AddWaypoint potentially using wrong walkspeed, if there are
multiple characters or objects moving simultaneously.
An example of a script that would cause a bug:
cEgo.AddWaypoint(20, 20);
oObject0.Move(0, 160, 1, eNoBlock, eAnywhere);
cEgo.AddWaypoint(200, 200);
from upstream 9a00255a2699845bd0e53054d81c24e6955f663e
This fixes repeated post-state on/off switching, and as a consequence - endless loop
in cause of a "..." sentence, that is run until messagetime reaches -1 on its own,
which did not happen because of repeated post-state.
NOTE: looks like an original bug introduced along with the DisplayPostTimeMs property.
From upstream 37360990b22a79380f2a5b34e686a2d2fbcf7de1
if called again
This makes Character.WalkStraight() have the same animation
keeping logic as Character.Walk().
Also reduce code duplication by calling walk_or_move_character()
which handles blocking movement already.
From upstream c5b04eb0c8991026ebca593d6f3254dfe96fd290
This fixes idle animation getting reset to frame 0 at the blocking speech start
if there's no speech view set. In such case the idle anim is expected to continue
playing seamlessly.
From upstream 7b399933a291a05e868cd9589b02d83d05f33314
Since older commit 5f3b8eb the properties are stored in vectors,
strictly resized to the number of characters and objects.
But the script functions that access these do not do any assertion
whether the object or char is valid, which could cause bad mem
access in case script loops over a array of objects of MAX_OBJECTS
size, or tries to access something using Object* pointer from another room.
From upstream 6ad4b220d75a32ea8df959e9a7b7f1ecb21d0c26
Before checking if an animation frame is not used (numFrames < 1),
make sure that the addressed frame is actually present in the loops vector.
Fixes#14491 affecting blackwell2, mountainsofmadness and possibly others
From upstream 08aef03ac693c28cc632f566d0a3a17dba48e157
This is a better fix for the crash in the Fatman intro, so
my original workaround has been removed