]> jfr.im git - irc/gameservirc.git/commitdiff
Bugfix relating to player fights (in Changes file) and fixed the run script.
authorkainazzzo <redacted>
Mon, 1 Dec 2003 18:52:08 +0000 (18:52 +0000)
committerkainazzzo <redacted>
Mon, 1 Dec 2003 18:52:08 +0000 (18:52 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@77 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/Changes
gameserv/contrib/README [new file with mode: 0644]
gameserv/gameserv.cpp
gameserv/run

index e668ede11c760b93f4e3e2a384e57e7616cf7e36..f0c2bd51bea7d5339aef98994e30290ad1ae867d 100644 (file)
@@ -1,4 +1,7 @@
 Version 1.1.6
+* Fixed a bug that allowed a player already in a fight to be challenged
+    by another player. The other player was then locked into the fight
+    with no way out.
 * Added a use command that allows a player to use items in their inventory.
     Currently the only items are health, strength, and defense potions.
     Command may be used in battle, but it costs you your turn.
diff --git a/gameserv/contrib/README b/gameserv/contrib/README
new file mode 100644 (file)
index 0000000..80bcab7
--- /dev/null
@@ -0,0 +1,7 @@
+These are patches that are made by people who have downloaded GameServ,
+modified the code, and run the diff command against the distribution
+code.
+
+In order to install the patch on your copy of gameserv, simply copy the
+.diff file into the GameServ parent directory, and type the following:
+patch -p0 < filename.diff
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
index 7b658535dc35a242be1341c296526935214a9616..e93ed72d9dd74e3dd9a9b4d580ebf03c0949ee54 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/bash
-nohup ./gameserv > /dev/null 2>1&
+nohup ./gameserv > /dev/null 2>&1