home · contact · privacy
get_nventory_slot_to_consume(t): Eat anything if deep in the red.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 8 Sep 2015 12:00:11 +0000 (14:00 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 8 Sep 2015 12:00:11 +0000 (14:00 +0200)
roguelike-server

index ac4f6e8fd86ef206e9e8fc5867acfb009f927723..c6e096e0591332fd40332c6e4cf58835ea6b3e04 100755 (executable)
@@ -997,6 +997,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