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

Function calcscoresmatch

source/src/server.cpp:2146–2163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2144}
2145
2146int calcscoresmatch() // match skill eval
2147{
2148 int sum = 0;
2149 int nsp = 0; // no score players
2150 loopv(clients) if(clients[i]->type!=ST_EMPTY)
2151 {
2152 if(clients[i]->team < TEAM_CLA_SPECT)
2153 {
2154 clientstate &cs = clients[i]->state;
2155 int cskill = (cs.frags*100 + cs.enemyfire*2 + cs.goodflags*10) - (cs.deaths*50 + cs.friendlyfire*3 + cs.antiflags*15 + cs.teamkills*100 + cs.suicides*100);
2156 clients[i]->at3_score = cskill;
2157 sum -= cskill; // match skill sum will be <=0
2158 if(cskill < 100) nsp++;
2159 }
2160 }
2161 if(sum > -100 * numplayers() || nsp >= numplayers()/2) return 0; // if at least half have tiny scores or the total isn't enough: indicate random seems best
2162 return sum;
2163}
2164
2165int calcscores()
2166{

Callers 1

calcscoresFunction · 0.85

Calls 2

numplayersFunction · 0.85
loopvFunction · 0.70

Tested by

no test coverage detected