Food meter now gets updated in a timely manner.
authorMartin Read <martin@blackswordsonics.com>
Wed, 26 Feb 2014 03:42:44 +0000 (03:42 +0000)
committerMartin Read <martin@blackswordsonics.com>
Wed, 26 Feb 2014 03:42:44 +0000 (03:42 +0000)
notify-local-tty.cc, notify.hh: Rejigged hunger notifications
u.cc: Use new approach to hunger notification

notify-local-tty.cc
notify.hh
u.cc

index c6d8408..70e881b 100644 (file)
@@ -181,9 +181,14 @@ void notify_player_regen(void)
     print_msg("Your ring pulses soothingly.\n");
 }
 
-void notify_hunger_level(int severity)
+void notify_food_use(int amount, int hunger_severity)
 {
-    switch (severity)
+    if (amount != 0)
+    {
+        status_updated = true;
+        display_update();
+    }
+    switch (hunger_severity)
     {
     case 0:
     default:
index 419114e..d8b0abc 100644 (file)
--- a/notify.hh
+++ b/notify.hh
@@ -44,13 +44,13 @@ void notify_hp_gain(int amount);
 void notify_player_teleport(void);
 void notify_player_telefail(void);
 void notify_player_regen(void);
-void notify_hunger_level(int severity);
 void notify_leadfoot_recovered(void);
 void notify_armourmelt_recovered(void);
 void notify_wither_recovered(void);
 void notify_protection_lost(void);
 void notify_wasted_gain(void);
 void notify_defence_recalc(void);
+void notify_food_use(int food_use, int hunger_severity);
 
 // Resistance notifications
 
diff --git a/u.cc b/u.cc
index 42436c3..e847902 100644 (file)
--- a/u.cc
+++ b/u.cc
@@ -476,7 +476,7 @@ void update_player(void)
             squeal = 2;
         }
         u.food -= food_use;
-        notify_hunger_level(squeal);
+        notify_food_use(food_use, squeal);
     }
     if (u.leadfoot > 0)
     {