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

Function loopv

source/src/worldio.cpp:295–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293{
294 DEBUG("parsing " << headerextras.length() << " packets");
295 loopv(headerextras)
296 {
297 ucharbuf q(headerextras[i]->data, headerextras[i]->len);
298 int type = headerextras[i]->flags & HX_TYPEMASK;
299 DEBUG("packet " << i << " type " << type);
300 bool deletethis = false; // (set deletethis for headers that persist outside headerextras and get reinserted by packheaderextras())
301 if(!(ignoretypes & (1 << type))) switch(type)
302 {
303 case HX_EDITUNDO:
304 restoreeditundo(q);
305 break;
306
307 case HX_CONFIG:
308 setcontext("map", "embedded");
309 if(headerextras[i]->len > 0 && headerextras[i]->data[headerextras[i]->len - 1] == '\0') execute((const char *)q.buf); // needs to have '\0' at the end, better check...
310 else conoutf("malformed emb config");
311 resetcontext();
312 break;
313
314 case HX_MAPINFO:
315 {
316 string l, c;
317 getstring(l, q, MAXSTRLEN - 1);
318 getstring(c, q, MAXSTRLEN - 1);
319 setmapinfo(l, c);
320 break;
321 }
322 case HX_MODEINFO:
323 case HX_ARTIST:
324 default:
325 break;
326 }
327 if(deletethis || (clearnonpersist && !(headerextras[i]->flags & HX_FLAG_PERSIST))) delete headerextras.remove(i--);
328 }
329}
330
331ucharbuf packheaderextras(int ignoretypes = 0) // serialise all extra data packets to save with the map header

Callers 13

listheaderextrasFunction · 0.70
findheaderextraFunction · 0.70
packheaderextrasFunction · 0.70
getcurrentmapconfigFunction · 0.70
save_worldFunction · 0.70
save_world9Function · 0.70
enumfilesFunction · 0.70
xmapMethod · 0.70
restoreMethod · 0.70
writeMethod · 0.70
worldio.cppFile · 0.70
writeallxmapsFunction · 0.70

Calls 15

restoreeditundoFunction · 0.85
setcontextFunction · 0.85
executeFunction · 0.85
resetcontextFunction · 0.85
getstringFunction · 0.85
setmapinfoFunction · 0.85
clampentityattributesFunction · 0.85
lilswapFunction · 0.85
getmminfoFunction · 0.85
loadxmapFunction · 0.85
copystringFunction · 0.85
xmapfilenameFunction · 0.85

Tested by

no test coverage detected