sync player state with other players on spawn

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2615 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-09-15 05:54:01 +00:00
parent 9507058d56
commit feb4cbd82e
2 changed files with 31 additions and 9 deletions
+9 -6
View File
@@ -297,13 +297,16 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
case SV_SPAWN:
{
int ls = getint(p), gunselect = getint(p);
if(!d) break;
d->respawn();
d->spawnstate(gamemode);
d->lifesequence = ls;
playerent *s = d;
if(!s) { static playerent dummy; s = &dummy; }
s->respawn();
s->lifesequence = getint(p);
s->health = getint(p);
s->armour = getint(p);
s->selectweapon(getint(p));
loopi(NUMGUNS) s->ammo[i] = getint(p);
loopi(NUMGUNS) s->mag[i] = getint(p);
d->state = CS_SPAWNING;
d->selectweapon(gunselect);
break;
}