Fix impossible to become mutant after mutant gear got deleted (bug 804)
authorWuzzy <Wuzzy2@mail.ru>
Tue, 07 Jan 2020 13:21:04 +0100
changeset 15559 bbb98e22a303
parent 15558 a798e6441a36
child 15560 c2445fcd1d38
Fix impossible to become mutant after mutant gear got deleted (bug #804)
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
--- a/ChangeLog.txt	Sat Jan 04 01:39:13 2020 +0300
+++ b/ChangeLog.txt	Tue Jan 07 13:21:04 2020 +0100
@@ -7,6 +7,7 @@
  + Racer: Reset mines, air mines and sticky mines every turn
  + A Space Adventure: Spacetrip: Meteorite appears blown-up after victory
  * Racer: Resize waypoints in custom-sized drawn maps
+ * Mutant: Fix impossible to become mutant after mutant is gone
  * A Space Adventure: The First Stop: Fix broken victory condition when eliminating minions
  * A Space Adventure: Killing the Specialists: Don't award player health if enemy hurts itself
  * Fix hog getting stuck when opening parachute right after a shoryuken digging through land
--- a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Sat Jan 04 01:39:13 2020 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua	Tue Jan 07 13:21:04 2020 +0100
@@ -816,6 +816,11 @@
     if GetGearType(gear) == gtHedgehog then
         numhhs = numhhs - 1
 
+        if (not gameOver) and (gear == mutant) then
+            mutant = nil
+            mt_hurt = false
+        end
+
         local found
         for i=0, #hhs do
             if hhs[i] == gear then