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

Function newclient

source/src/clientgame.cpp:1042–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040}
1041
1042playerent *newclient(int cn) // ensure valid entity
1043{
1044 if(cn<0 || cn>=MAXCLIENTS)
1045 {
1046 neterr("clientnum");
1047 return NULL;
1048 }
1049 while(cn>=players.length()) players.add(NULL);
1050 playerent *d = players[cn];
1051 if(d) return d;
1052 d = newplayerent();
1053 players[cn] = d;
1054 d->clientnum = cn;
1055 return d;
1056}
1057
1058playerent *getclient(int cn) // ensure valid entity
1059{

Callers 2

parsemessagesFunction · 0.85
loopiFunction · 0.85

Calls 4

neterrFunction · 0.85
newplayerentFunction · 0.85
lengthMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected