home · contact · privacy
get_inventory_slot_to_consume(t): Eat anything if deep in the red.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 14 Mar 2015 05:36:16 +0000 (06:36 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 14 Mar 2015 05:36:16 +0000 (06:36 +0100)
roguelike-server

index 63fd016e9f8f11aabcc5f61ad37ede9d08e84c9d..2a987fd88961d913844d1a3daa555209a59b80f8 100755 (executable)
@@ -1305,6 +1305,7 @@ def get_inventory_slot_to_consume(t):
             nutvalue = world_db["ThingTypes"][type]["TT_TOOLPOWER"]
             tmp_cmp = abs(t["T_SATIATION"] + nutvalue - consume_hungering)
             if (cmp_food < 0 and tmp_cmp < abs(t["T_SATIATION"])) \
+            or (cmp_food < 0 and 0 > t["T_SATIATION"] + nutvalue) \
             or tmp_cmp < cmp_food:
                 cmp_food = tmp_cmp
                 selection = i