MCPcopy Create free account
hub / github.com/assaultcube/AC / loopi

Function loopi

source/src/clients2c.cpp:751–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749 case SV_RESUME:
750 {
751 loopi(MAXCLIENTS)
752 {
753 int cn = getint(p);
754 if(p.overread() || cn<0) break;
755 int state = getint(p),
756 lifesequence = getint(p),
757 primary = getint(p),
758 gunselect = getint(p),
759 flagscore = getint(p),
760 frags = getint(p),
761 deaths = getint(p),
762 health = getint(p),
763 armour = getint(p),
764 teamkills = getint(p);
765 int ammo[NUMGUNS], mag[NUMGUNS];
766 loopi(NUMGUNS) ammo[i] = getint(p);
767 loopi(NUMGUNS) mag[i] = getint(p);
768 playerent *d = (cn == getclientnum() ? player1 : newclient(cn));
769 if(!d) continue;
770 if(d!=player1) d->state = state;
771 d->lifesequence = lifesequence;
772 d->flagscore = flagscore;
773 d->frags = frags;
774 d->deaths = deaths;
775 d->tks = teamkills;
776 if(d!=player1)
777 {
778 d->setprimary(primary);
779 d->selectweapon(gunselect);
780 d->health = health;
781 d->armour = armour;
782 memcpy(d->ammo, ammo, sizeof(ammo));
783 memcpy(d->mag, mag, sizeof(mag));
784 if(d->lifesequence==0) d->resetstats(); //NEW
785 }
786 }
787 break;
788 }
789

Callers 1

parsemessagesFunction · 0.70

Calls 13

getintFunction · 0.85
getclientnumFunction · 0.85
newclientFunction · 0.85
getstringFunction · 0.85
filtertextFunction · 0.85
concatformatstringFunction · 0.85
menuitemmanualFunction · 0.85
overreadMethod · 0.80
setprimaryMethod · 0.80
selectweaponMethod · 0.80
resetstatsMethod · 0.80
conoutfFunction · 0.70

Tested by

no test coverage detected