fixed bug when using different normal and deadly shield time
authorHolger Schemel <info@artsoft.org>
Mon, 25 Jul 2022 17:22:01 +0000 (19:22 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 25 Jul 2022 17:22:01 +0000 (19:22 +0200)
src/game.c

index 1cc2f72b6a42f55b412607049633ed5f1ed1a588..4b7533ad779cabe27e85c770da5dae961eaf2378 100644 (file)
@@ -14430,9 +14430,13 @@ static int DigField(struct PlayerInfo *player,
     }
     else if (element == EL_SHIELD_NORMAL || element == EL_SHIELD_DEADLY)
     {
-      player->shield_normal_time_left += level.shield_normal_time;
+      int shield_time = (element == EL_SHIELD_DEADLY ?
+                        level.shield_deadly_time :
+                        level.shield_normal_time);
+
+      player->shield_normal_time_left += shield_time;
       if (element == EL_SHIELD_DEADLY)
-       player->shield_deadly_time_left += level.shield_deadly_time;
+       player->shield_deadly_time_left += shield_time;
     }
     else if (element == EL_DYNAMITE ||
             element == EL_EM_DYNAMITE ||