# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1554663209 -7200
# Node ID b39da9cf7616e9b2356251f399b50e47481048f2
# Parent  168be33c099a95bc94a00512ae78428ec1cde864
Renew crate health display when health changed

diff -r 168be33c099a -r b39da9cf7616 hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sun Apr 07 20:03:09 2019 +0200
+++ b/hedgewars/uScript.pas	Sun Apr 07 20:53:29 2019 +0200
@@ -1865,9 +1865,9 @@
                     gear^.Health:= 0;
                 RenderHealth(gear^.Hedgehog^);
                 RecountTeamHealth(gear^.Hedgehog^.Team)
-                end;
-            // Why did this do a "setalltoactive" ?
-            //SetAllToActive;
+                end
+            else if (gear^.RenderHealth) and (gear^.Tex <> nil) then
+                FreeAndNilTexture(gear^.Tex);
             Gear^.Active:= true;
             AllInactive:= false
             end