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

Function preparectf

source/src/clientgame.cpp:1093–1113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1091}
1092
1093void preparectf(bool cleanonly=false)
1094{
1095 loopi(2) initflag(i);
1096 if(!cleanonly)
1097 {
1098 loopv(ents)
1099 {
1100 entity &e = ents[i];
1101 if(e.type==CTF_FLAG)
1102 {
1103 e.spawned = true;
1104 if(e.attr2>=2) { conoutf("\f3invalid ctf-flag entity (%d)", i); e.attr2 = 0; }
1105 flaginfo &f = flaginfos[e.attr2];
1106 f.flagent = &e;
1107 f.pos.x = (float) e.x;
1108 f.pos.y = (float) e.y;
1109 f.pos.z = (float) e.z;
1110 }
1111 }
1112 }
1113}
1114
1115struct gmdesc { int mode; char *desc; };
1116vector<gmdesc> gmdescs;

Callers 1

startmapFunction · 0.85

Calls 2

initflagFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected