]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/gameserv.cpp
Fixed some bugs
[irc/gameservirc.git] / gameserv / gameserv.cpp
index 6ac8c76de279d6b90be0615088ff6ba541dccfa5..ea8d6fff213fed79b840da3d3c6ed768ee2e1047 100644 (file)
@@ -538,7 +538,6 @@ void do_list(char *u)
        notice(s_GameServ, u, "People Playing:");
        while(temp)
        {
-
            #ifdef P10
            notice(s_GameServ, u, "IRC: %s     Game: %s", temp->getData()->getRealNick(), 
                   temp->getData()->stats->name);
@@ -577,6 +576,11 @@ void do_register(char *u)
     {
        notice(s_GameServ, u, "SYNTAX: /msg %S REGISTER NAME PASSWORD");
     }
+    else if ((user = findplayer(name)))
+    {
+       notice(s_GameServ, u, "%s is already registered!", name);
+       notice(s_GameServ, u, "Choose another name!");
+    }
     else if ((user = find(u)))
     {
        p = findplayer(u);
@@ -616,7 +620,7 @@ void do_identify(char *u)
     }
     else if (!(p = findplayer(name)) || !p->stats)
            notice(s_GameServ, u, "Player %s not found", name);
-    else if (p->stats->user == NULL && !isAdmin(user))
+    else if (p->stats->user != NULL && !isAdmin(user))
     {
        notice(s_GameServ, u, "That player has already identified.");
        return;
@@ -974,14 +978,14 @@ void do_fight(char *u)
        notice(s_GameServ, u, "Fatal error. Contact a(n) %S admin. buf: %s", strtok(NULL, ""));
        return;
     }
-    else if (!(battle = findbyrealnick(nick)))
+    else if (!is_playing(ni))
     {
-       notice(s_GameServ, u, "You can't attack %s while they aren't playing!", nick);
+       notice(s_GameServ, u, "You are not playing!");
        return;
     }
-    else if (!is_playing(ni))
+    else if (!(battle = findplayer(nick)))
     {
-       notice(s_GameServ, u, "You are not playing!");
+       notice(s_GameServ, u, "You can't attack %s while they aren't playing!", nick);
        return;
     }
 /*
@@ -1046,9 +1050,12 @@ void do_fight(char *u)
        clearYourTurn(battle->stats);
 
        // Initiate Battle sequence!
+       battle->stats->player_fights -= 1;
+
         notice(s_GameServ, u, "You challenge %s to an online duel!", battle->stats->name);
         notice(s_GameServ, battle->getNick(), "%s has challenged you to an online duel!", ni->stats->name);
-        notice(s_GameServ, battle->getNick(), "%s gets to go first because he initiated!", ni->stats->name);
+        notice(s_GameServ, battle->getNick(), "%s gets to go first "\
+                       "because they initiated!", ni->stats->name);
         notice(s_GameServ, battle->getNick(), "Please wait while %s decides what to do.", ni->stats->name);
         display_players(u);
     }