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