From e14725cf0163872953639fc314a16c3c31706bc2 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 1 Sep 2015 03:16:22 +0200
Subject: [PATCH] turn_over(): hunger() before Thing action, so no suicide
 corpses hunger.

---
 roguelike-server | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/roguelike-server b/roguelike-server
index 0b9af47..e4b23e0 100755
--- a/roguelike-server
+++ b/roguelike-server
@@ -1048,15 +1048,16 @@ def turn_over():
                         break
                     ai(Thing)
                 try_healing(Thing)
-                Thing["T_PROGRESS"] += 1
-                taid = [a for a in world_db["ThingActions"]
-                        if a == Thing["T_COMMAND"]][0]
-                ThingAction = world_db["ThingActions"][taid]
-                if Thing["T_PROGRESS"] == ThingAction["TA_EFFORT"]:
-                    eval("actor_" + ThingAction["TA_NAME"])(Thing)
-                    Thing["T_COMMAND"] = 0
-                    Thing["T_PROGRESS"] = 0
                 hunger(Thing)
+                if Thing["T_LIFEPOINTS"]:
+                    Thing["T_PROGRESS"] += 1
+                    taid = [a for a in world_db["ThingActions"]
+                              if a == Thing["T_COMMAND"]][0]
+                    ThingAction = world_db["ThingActions"][taid]
+                    if Thing["T_PROGRESS"] == ThingAction["TA_EFFORT"]:
+                        eval("actor_" + ThingAction["TA_NAME"])(Thing)
+                        Thing["T_COMMAND"] = 0
+                        Thing["T_PROGRESS"] = 0
             thingproliferation(Thing, proliferable_map)
         if whilebreaker:
             break
-- 
2.30.2