+
+ /* try to detect and fix "Snake Bite" levels, which are broken with 3.2.0 */
+ {
+ int element = EL_CUSTOM_START + 255;
+ struct ElementInfo *ei = &element_info[element];
+ struct ElementChangeInfo *change = &ei->change_page[0];
+
+ /* This is needed to fix a problem that was caused by a bugfix in function
+ game.c/CreateFieldExt() introduced with 3.2.0 that corrects the behaviour
+ when a custom element changes to EL_SOKOBAN_FIELD_PLAYER (before, it did
+ not replace walkable elements, but instead just placed the player on it,
+ without placing the Sokoban field under the player). Unfortunately, this
+ breaks "Snake Bite" style levels when the snake is halfway through a door
+ that just closes (the snake head is still alive and can be moved in this
+ case). This can be fixed by replacing the EL_SOKOBAN_FIELD_PLAYER by the
+ player (without Sokoban element) which then gets killed as designed). */
+
+ if ((strncmp(leveldir_current->identifier, "snake_bite", 10) == 0 ||
+ strncmp(ei->description, "pause b4 death", 14) == 0) &&
+ change->target_element == EL_SOKOBAN_FIELD_PLAYER)
+ change->target_element = EL_PLAYER_1;
+ }