changed how custom elements change to player if they are walkable
[rocksndiamonds.git] / src / game.c
index be192e4fecda551a84af7b27346773c0571ae37c..3d99a11322b18df7d8daf4c8501b405f18633b2c 100644 (file)
@@ -10832,6 +10832,10 @@ static boolean ChangeElement(int x, int y, int element, int page)
       Store[x][y] = EL_EMPTY;
     }
 
+    // special case: element changes to player (and may be kept if walkable)
+    if (ELEM_IS_PLAYER(target_element) && !level.keep_walkable_ce)
+      CreateElementFromChange(x, y, EL_EMPTY);
+
     CreateElementFromChange(x, y, target_element);
 
     PlayLevelSoundElementAction(x, y, element, ACTION_CHANGING);