tFix for the AI players halting if they try to attack a player that has just left the current location. - vaccinewars - be a doctor and try to vaccinate the world (HTM) git clone git://src.adamsgaard.dk/vaccinewars (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 1388ce190ee5000a2bd29614b532f447e142ae42 (DIR) parent 22eebd0d63eb25445cceac13aeb48b9f0e8ae4ef (HTM) Author: Ben Webb <ben@salilab.org> Date: Fri, 2 Aug 2002 12:58:13 +0000 Fix for the AI players halting if they try to attack a player that has just left the current location. Diffstat: M src/AIPlayer.c | 3 +++ M src/message.h | 3 ++- M src/serverside.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) --- (DIR) diff --git a/src/AIPlayer.c b/src/AIPlayer.c t@@ -334,6 +334,9 @@ int HandleAIMessage(char *Message, Player *AIPlay) break; case C_PRINTMESSAGE: PrintAIMessage(Data); + if (AICode == C_MISSFIGHT || strncmp(Data, "Too late", 8) == 0) { + AIJet(AIPlay); + } break; case C_MSG: g_print("%s: %s\n", GetPlayerName(From), Data); (DIR) diff --git a/src/message.h b/src/message.h t@@ -49,7 +49,8 @@ typedef enum { C_NONE = 'A', C_ASKLOAN, C_COPSMESG, C_ASKBITCH, C_ASKGUN, C_ASKGUNSHOP, C_ASKPUB, C_ASKBANK, C_ASKRUN, C_ASKRUNFIGHT, C_ASKSEW, - C_MEETPLAYER, C_FIGHT, C_FIGHTDONE, C_MOTD, C_VERSIONCHECK + C_MEETPLAYER, C_FIGHT, C_FIGHTDONE, C_MOTD, C_VERSIONCHECK, + C_MISSFIGHT } AICode; #define DT_LOCATION 'A' (DIR) diff --git a/src/serverside.c b/src/serverside.c t@@ -3367,7 +3367,7 @@ void HandleAnswer(Player *From, Player *To, char *answer) } else { text = g_strdup_printf(_("Too late - %s has just left!"), GetPlayerName(Defender)); - SendPrintMessage(NULL, C_NONE, From, text); + SendPrintMessage(NULL, C_MISSFIGHT, From, text); g_free(text); From->EventNum++; SendEvent(From);