projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5ef9148
)
added function to remove player and cleanup last player field
author
Holger Schemel
<info@artsoft.org>
Fri, 17 Aug 2018 09:04:25 +0000
(11:04 +0200)
committer
Holger Schemel
<info@artsoft.org>
Fri, 17 Aug 2018 09:04:25 +0000
(11:04 +0200)
src/game.c
patch
|
blob
|
history
diff --git
a/src/game.c
b/src/game.c
index 2cf0e9aa46a468e4eacf98bf528d34964359d322..7076d52c6c70bfbb809c435d9ecd83d94929f8a7 100644
(file)
--- 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 KillPlayer(struct PlayerInfo *);
void BuryPlayer(struct PlayerInfo *);
void RemovePlayer(struct PlayerInfo *);
+void RemovePlayerWithCleanup(struct PlayerInfo *);
static int getInvisibleActiveFromInvisibleElement(int);
static int getInvisibleFromInvisibleActiveElement(int);
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 */
{
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]))
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;
}
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];
static void setFieldForSnapping(int x, int y, int element, int direction)
{
struct ElementInfo *ei = &element_info[element];