Complete.Org: Mailing Lists: Archives: freeciv-dev: May 1999:
[Freeciv-Dev] Famine Warnings
Home

[Freeciv-Dev] Famine Warnings

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Famine Warnings
From: Michael Gastright <gastrig@xxxxxxxxx>
Date: Thu, 20 May 1999 02:00:49 +0000

Greetings,

Here is the cvs diff for better warnings on famine events.  Again,
nothing complicated - just a little better warning before the famine
actually happens.

Later,

Michael Gastright
Index: cityturn.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v
retrieving revision 1.56
diff -u -r1.56 cityturn.c
--- cityturn.c  1999/05/15 04:55:25     1.56
+++ cityturn.c  1999/05/20 01:57:32
@@ -838,6 +838,17 @@
 void city_populate(struct city *pcity)
 {
   pcity->food_stock+=pcity->food_surplus;
+
+  if ((pcity->food_surplus < 0) && (pcity->food_stock >= 0))
+    if ((pcity->food_stock + pcity->food_surplus) < 0)
+       notify_player_ex(city_owner(pcity), pcity->x, pcity->y, E_CITY_FAMINE,
+                         "Game: Famine feared NEXT TURN in %s! (%d)",
+                         pcity->name, pcity->food_surplus);
+    else
+       notify_player_ex(city_owner(pcity), pcity->x, pcity->y, E_CITY_FAMINE,
+                         "Game: People in %s are hungry! (%d)",
+                         pcity->name, pcity->food_surplus);
+
   if(pcity->food_stock >= pcity->size*game.foodbox)
     city_increase_size(pcity);
   else if(pcity->food_stock<0) {
@@ -845,7 +856,7 @@
       if (unit_flag(punit->type, F_SETTLERS)) {
        wipe_unit(0, punit);
        notify_player_ex(city_owner(pcity), pcity->x, pcity->y, E_UNIT_LOST,
-                        "Game: Famine feared in %s, Settlers lost!",
+                         "Game: Famine HAPPENED in %s, Settlers lost!",
                         pcity->name);
        gamelog(GAMELOG_UNITFS, "%s lose Settlers (famine)",
                get_race_name_plural(game.players[pcity->owner].race));


[Prev in Thread] Current Thread [Next in Thread]