[freeciv-ai] patch/rfc: wrap activity
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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);
}
- [freeciv-ai] patch/rfc: wrap activity,
Per I. Mathisen <=
|
|