From: Holger Schemel Date: Fri, 17 Aug 2018 09:04:25 +0000 (+0200) Subject: added function to remove player and cleanup last player field X-Git-Tag: 4.1.1.0~81 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=6e7af3cc6bf12e02a3b0ea576a3ffb9e7c32b0ba added function to remove player and cleanup last player field --- diff --git a/src/game.c b/src/game.c index 2cf0e9aa..7076d52c 100644 --- a/src/game.c +++ b/src/game.c @@ -1112,6 +1112,7 @@ void TestIfGoodThingGetsHitByBadThing(int, int, int); void KillPlayer(struct PlayerInfo *); void BuryPlayer(struct PlayerInfo *); void RemovePlayer(struct PlayerInfo *); +void RemovePlayerWithCleanup(struct PlayerInfo *); static int getInvisibleActiveFromInvisibleElement(int); static int getInvisibleFromInvisibleActiveElement(int); @@ -12641,8 +12642,7 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) Feld[jx][jy] == EL_SP_EXIT_OPEN || Feld[jx][jy] == EL_SP_EXIT_OPENING) /* <-- special case */ { - DrawPlayer(player); /* needed here only to cleanup last field */ - RemovePlayer(player); + RemovePlayerWithCleanup(player); if (local_player->friends_still_needed == 0 || IS_SP_ELEMENT(Feld[jx][jy])) @@ -13402,6 +13402,12 @@ void RemovePlayer(struct PlayerInfo *player) ExitY = ZY = jy; } +void RemovePlayerWithCleanup(struct PlayerInfo *player) +{ + DrawPlayer(player); /* needed here only to cleanup last field */ + RemovePlayer(player); +} + static void setFieldForSnapping(int x, int y, int element, int direction) { struct ElementInfo *ei = &element_info[element];