X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/2ca6a3dec1cf7fa36851b9cb70e8e53fb0f75a79..7bbb4b570740f7abf7ddac7ebeae1b92c75521e4:/gameserv/do_attack.cpp diff --git a/gameserv/do_attack.cpp b/gameserv/do_attack.cpp index 70aa62b..e123d27 100644 --- a/gameserv/do_attack.cpp +++ b/gameserv/do_attack.cpp @@ -1,5 +1,6 @@ #include "aClient.h" #include "extern.h" +#include "options.h" #include "flags.h" #include "level.h" #include "player.h" @@ -14,7 +15,7 @@ void do_attack(char *u) if (!(ni = find(u))) { - notice(s_GameServ, u, "Fatal error in do_attack. Contact a(n) %S admin for help."); + notice(s_GameServ, u, "Fatal error in do_attack. Contact a(n) stats)) + if (!isYourTurn(ni->stats) && isYourTurn(battle->stats)) { notice(s_GameServ, u, "Please wait until %s decides what to do!", battle->stats->getName().c_str()); return; } - if (hit > 0) + else if (!isYourTurn(ni->stats) && !isYourTurn(battle->stats)) + { + // If somehow the player vs. player fight hangs, give the turn to the first attacker + setYourTurn(ni->stats); + } + if (hit > 0) { notice(s_GameServ, u, "You attack %s for %d points!", battle->stats->getName().c_str(), hit); @@ -261,6 +267,7 @@ void do_attack(char *u) { if (hit > 0) battle->stats->subtractHP(hit); + clearYourTurn(ni->stats); setYourTurn(battle->stats); display_players(battle);