From 3c57da01a18da64f1ac98602ed81a32170b8e744 Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Wed, 25 May 2011 15:59:20 +0000 Subject: [PATCH] bug fix, + onFlagEvent git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6463 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 724c8b7a..8199e1da 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -869,7 +869,7 @@ void dodamage(int damage, playerent *pl, playerent *actor, int gun, bool gib, bo pl->respawnoffset = pl->lastpain = lastmillis; // could the author of the FIXME below please elaborate what's to fix?! (ft:2011mar28) // I suppose someone wanted to play the hitsound for player1 or spectated player (lucas:2011may22) - playerent *h = player1->isspectating() && player1->followplayercn > 0 ? getclient(player1->followplayercn) : NULL; + playerent *h = player1->isspectating() && player1->followplayercn >= 0 ? getclient(player1->followplayercn) : NULL; if(!h) h = player1; if(actor==h && pl!=actor) { @@ -1256,6 +1256,12 @@ void flagmsg(int flag, int message, int actor, int flagtime) const char *teamstr = m_ktf ? "the" : own ? "your" : "the enemy"; const char *flagteam = m_ktf ? (teammate ? "your teammate " : "your enemy ") : ""; + if(identexists("onFlagEvent")) + { + defformatstring(onflagevent)("onFlagEvent %d %d %d", message, actor); + execute(onflagevent); + } + switch(message) { case FM_PICKUP: