mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
AGS: Engine: fixed WalkStraight() was resetting animation
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 commit is contained in:
parent
47b3cb7de7
commit
6166993f42
@ -959,7 +959,6 @@ void Character_WalkStraight(CharacterInfo *chaa, int xx, int yy, int blocking) {
|
||||
if (chaa->room != _G(displayed_room))
|
||||
quit("!MoveCharacterStraight: specified character not in current room");
|
||||
|
||||
Character_StopMoving(chaa);
|
||||
int movetox = xx, movetoy = yy;
|
||||
|
||||
set_wallscreen(prepare_walkable_areas(chaa->index_id));
|
||||
@ -976,13 +975,7 @@ void Character_WalkStraight(CharacterInfo *chaa, int xx, int yy, int blocking) {
|
||||
movetoy = mask_to_room_coord(lastcy);
|
||||
}
|
||||
|
||||
walk_character(chaa->index_id, movetox, movetoy, 1, true);
|
||||
|
||||
if ((blocking == BLOCKING) || (blocking == 1))
|
||||
GameLoopUntilNotMoving(&chaa->walking);
|
||||
else if ((blocking != IN_BACKGROUND) && (blocking != 0))
|
||||
quit("!Character.Walk: Blocking must be BLOCKING or IN_BACKGRUOND");
|
||||
|
||||
walk_or_move_character(chaa, movetox, movetoy, blocking, 1 /* use ANYWHERE */, true);
|
||||
}
|
||||
|
||||
void Character_RunInteraction(CharacterInfo *chaa, int mood) {
|
||||
@ -1947,7 +1940,7 @@ void walk_or_move_character(CharacterInfo *chaa, int x, int y, int blocking, int
|
||||
if ((blocking == BLOCKING) || (blocking == 1))
|
||||
GameLoopUntilNotMoving(&chaa->walking);
|
||||
else if ((blocking != IN_BACKGROUND) && (blocking != 0))
|
||||
quit("!Character.Walk: Blocking must be BLOCKING or IN_BACKGRUOND");
|
||||
quit("!Character.Walk: Blocking must be BLOCKING or IN_BACKGROUND");
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user