Complete.Org: Mailing Lists: Archives: freeciv-ai: November 2002:
[freeciv-ai] patch/rfc: wrap activity
Home

[freeciv-ai] patch/rfc: wrap activity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] patch/rfc: wrap activity
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 18 Nov 2002 14:02:34 +0000 (GMT)

This is the essential wrapper for retaining fortification status, taken
from massive ai patch. Shout if you think this is wrong, otherwise I will
commit along with the necessary wrapping changes elsewhere in the code.

  - Per

diff -u -r1.62 aitools.c

+/**************************************************************************
+  Gate all changes to unit activities through here to enforce sanity
+
+  FIXME: packetify request
++**************************************************************************/
+void ai_unit_new_activity(struct unit *punit, enum unit_activity task)
+{
+  if (punit->activity == task) {
+    return; /* useless */
+  }
+  if (punit->activity == ACTIVITY_FORTIFIED && task == ACTIVITY_FORTIFYING) {
+    return; /* worse than useless */
   }
+  handle_unit_activity_request(punit, task);
 }




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