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

Function accuracyinfo

source/src/weapon.cpp:901–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

899}
900
901void accuracyinfo()
902{
903 vector <char*>lines;
904 loopi(NUMGUNS) if(accuracym[i].shots)
905 {
906 float acc = 100.0 * accuracym[i].hits / (float)accuracym[i].shots;
907 string line;
908 if(i == GUN_GRENADE || i == GUN_SHOTGUN)
909 {
910 formatstring(line)("\f0%-10s\t\f5 %.1f%% (%.1f/%d)", weapstr(i), acc, accuracym[i].hits, accuracym[i].shots);
911 }
912 else
913 {
914 formatstring(line)("\f0%-10s\t\f5 %.1f%% (%d/%d)", weapstr(i), acc, (int)accuracym[i].hits, accuracym[i].shots);
915 }
916 lines.add(newstring(line));
917 }
918 loopv(lines) conoutf("%s", lines[i]);
919 lines.deletearrays();
920}
921
922COMMAND(accuracyinfo, "");
923

Callers

nothing calls this directly

Calls 7

weapstrFunction · 0.85
newstringFunction · 0.85
deletearraysMethod · 0.80
loopiFunction · 0.70
loopvFunction · 0.70
conoutfFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected