The first argument of MakeSectorActive can be either a string or a
number. If a number is used by the lua call lua_isstring will also return
true (see engines/grim/lua/lapi.cpp) and so the correct code which
handles the integer case is never called.
This patch reverses the order of the tests via lua_isstring and
lua_isnumber.
In EMI this fixes the following:
- big monkey head on Monkey Island stays open even after set or setup
change
- the lights in the bank on lucre island stay off until Guybrush turns
them on
- shadow of Pegnose's nose is visible in close-up camera view
When an actor which is drawn using sprites moved due to water float
effects and if that actor uses multiple sprites, then these sprites are
not aligned (e.g. in the very first scene, the ship in the background is
not shown as one piece).
That is because the sprites are first rotated and then moved to
the correct position. It is necessary to first move them to their
correct position on the actor and then rotate the whole actor.
Additionally, non-overworld sprites needs to be rotated by the Yaw axis.
Otherwise the ship did not rock but only moved vertically.
This changes fixes:
- the ship in the background in the first scene
- the clock hands in the swamp
- use the costumeName instead of a pointer to the costume object to
check, whether the current costume matches the requested one
- this fixes an uninitialized pointer read
When mapping a sprite to a GL polygon its dimensions are scaled by the ratio
between the current screen resolution and the native game resolution. When
the polygon is rendered it is scaled again, causing sprites to be displayed
unproportionally big when using larger screen resolutions.
All other methods of TextSplitter ignore the case: the strings of the
splitted text are changed to lowercase and other strings provided via
arguments are compared case-insensitive.
- the costumes are handled on a stack per Actor
- the last costume is considered the current one
- currently, the costumes are never removed from from the stack
- this causes an issue when Guybrush is using its original
costume first, later the monkey robot costume for the final Monkey Kombat
and then again the standard costume (the robot costume will remain the last
on the stack and cosidered the current one - this causes a problem
when attaching the head actor since the robot has different joints
than guybrush with the standard costume)
- if a new wear chore is set and it uses a different costume than the
current one and neither of them is the shadow costume remove the old
costume before setting the new one
- additionally, this patch makes sure, that all active chores of all
costumes on the stack of an actor are stopped
- for solving the Monkey Kombat puzzle it is necessary that a kombat is
triggered when Guybrush runs into one of the monkeys on the map
- implement SetActorCollisionMode and SetActorCollisionScale
- add EMI-specific calculations for retrieving the sphere data for the
actors (and some minor refactoring for better readability)
The following changes may alter the behaviour in GRIM, too:
- in Actor::collisionHandlerCallback(), call the collision handler for
both affected objects (that is necessary since only one actor may have
a collision handler associated in lua but it may happen that the
character with the handler is standing still and the other one is run
into him)
- Actor::handleCollisionTo() did only update a given position to ensure
that there is no collision - so it is necessary to actually check for
collisions and execute the lua callback if necessary (via
Actor::handleCollisionWith())
Some sets (e.g. the big monkey's engine room) set Guybrush's sort order
to a large value, causing him to become invisible in other places. This
patch resets the sort order for all actors when switching to a new set.
- the order of the active actors is based on the effective sort order
which is based on the sortorder of actors itself but also on the
attached actors
- invalidate the sortorder also when detaching actors
- this fixes two glitches in the final end scene (guybrush is still
displayed after falling from the cliff and monkey robot is drawn in
the foreground)
The path to the Curch of LeChuck has bogus coordinates as out point, so
the game will walk Guybrush to an invalid position when entering that
set. This patch will detect when no path can be found to the destination
position and ignore the walkTo() request in that case.
The behavior for Grim is unchanged in order to avoid the risk of breaking
the game. If the warning is never triggered the distinction can be removed.