From e542188cd4ecc0e9716b1864e052e7d7d836e728 Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Sun, 11 Mar 2012 10:55:20 +0000 Subject: [PATCH] weird crashes "fix" (still fixme) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6767 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/protocol.cpp | 2 +- source/src/server.cpp | 3 ++- source/src/weapon.cpp | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/src/protocol.cpp b/source/src/protocol.cpp index ddd68cdb..789c06a8 100644 --- a/source/src/protocol.cpp +++ b/source/src/protocol.cpp @@ -98,7 +98,7 @@ template static inline void sendstring_(const char *text, T &p) { const char *t = text; - while(*t) putint(p, *t++); + if(t) { while(*t) putint(p, *t++); } putint(p, 0); DEBUGVAR(text); } diff --git a/source/src/server.cpp b/source/src/server.cpp index 97f78f06..46f24b69 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -3998,7 +3998,8 @@ void extinfo_statsbuf(ucharbuf &p, int pid, int bpos, ENetSocket &pongsock, ENet putint(p,clients[i]->clientnum); //add player id putint(p,clients[i]->ping); //Ping sendstring(clients[i]->name,p); //Name - sendstring(team_string(clients[i]->team),p); //Team + sendstring(team_string(clients[i]->team),p); //Team + // "team_string(clients[i]->team)" sometimes return NULL according to RK, causing the server to crash. WTF ? putint(p,clients[i]->state.frags); //Frags putint(p,clients[i]->state.flagscore); //Flagscore putint(p,clients[i]->state.deaths); //Death diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 5f8eaf6b..716a0e8f 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1619,7 +1619,6 @@ void checkweaponstate() { checkweaponswitch(); checkakimbo(); - playerent *p = (playerent *) camera1; - if(!p || !p->weaponsel) return; - if(lastmillis - p->weaponsel->reloading > p->weaponsel->info.reloadtime) p->weaponsel->reloading = 0; + + // TODO : here we need to check properly that the spectated player weapon has finished to reload... } \ No newline at end of file