]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/gameserv.cpp
Bugfix relating to player fights (in Changes file) and fixed the run script.
[irc/gameservirc.git] / gameserv / gameserv.cpp
index fff3388044b4d7d8c32605381d23305756cb5b7c..45057bc5c624175965fd11a50803654f72d66d1e 100644 (file)
@@ -2078,10 +2078,12 @@ void do_fight(char *u)
     else if (!(battle = find(nick)))
     {
        notice(s_GameServ, u, "You can't attack %s while they aren't playing!", nick);
+       return;
     }
     else if (!is_playing(ni))
     {
        notice(s_GameServ, u, "You are not playing!");
+       return;
     }
 /*
  * Offline fighting not implemented yet.
@@ -2101,6 +2103,16 @@ void do_fight(char *u)
        notice(s_GameServ, u, "You are dead. Wait until tomorrow to fight others!");
        return;
     }
+    else if (player_fight(battle))
+    {
+       notice(s_GameServ, u, "%s is fighting %s already!", battle->stats->name, battle->stats->battle->stats->name);
+       return;
+    }
+    else if (is_fighting(battle))
+    {
+       notice(s_GameServ, u, "%s is fighting %s already!", battle->stats->name, battle->stats->fight->name);
+       return;
+    }
     else if (is_playing(ni) && is_playing(battle) && stricmp(ni->stats->name, battle->stats->name) != 0)
     {
        // Set your battle pointer to the other player