weird crashes "fix" (still fixme)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6767 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2012-03-11 10:55:20 +00:00
parent 35e310ed1f
commit e542188cd4
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ template<class T>
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);
}
+2 -1
View File
@@ -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
+2 -3
View File
@@ -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...
}