From 067c39bb62d15d01d70ef93487d9201e340df57f Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Mon, 12 Jul 2010 18:15:18 +0000 Subject: [PATCH] the prototype of the future (to avoid future protocol changes) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5349 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clients2c.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 1843adc8..79f4943c 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -666,11 +666,16 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) case SV_POINTS: { int count = getint(p); - loopi(count){ - int pcn = getint(p); int score = getint(p); - playerent *ppl = pcn == getclientnum() ? player1 : getclient(pcn); - if (!ppl) break; - ppl->points += score; + if ( count > 0 ) { + loopi(count){ + int pcn = getint(p); int score = getint(p); + playerent *ppl = pcn == getclientnum() ? player1 : getclient(pcn); + if (!ppl) break; + ppl->points += score; + } + } else { + int medals = getint(p); + loopi(medals) { getint(p); getint(p); getint(p); } } break; }