From 814106359dd11219ffa518208f92a4bdac23d60c Mon Sep 17 00:00:00 2001 From: driAn Date: Wed, 26 Apr 2006 16:24:47 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@261 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 29 ++++++++++++++++------------- source/src/worldio.cpp | 5 ++++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 9ac2f25d..3767e2d7 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -498,29 +498,32 @@ void initclient() initclientnet(); }; -void preparectf() +void preparectf(bool cleanonly = false) { loopi(2) flaginfos[i].flag = NULL; - loopv(ents) + if(!cleanonly) { - entity &e = ents[i]; - if(e.type==CTF_FLAG) + loopv(ents) { - e.spawned = true; - if(e.attr2<0||e.attr2>2) { conoutf("invalid ctf-flag entity (%i)", i); e.attr2 = 0; }; - flaginfo &f = flaginfos[e.attr2]; - f.flag = &e; - f.state = CTFF_INBASE; - f.originalpos.x = (float) e.x; - f.originalpos.y = (float) e.y; - f.originalpos.z = (float) e.z; + entity &e = ents[i]; + if(e.type==CTF_FLAG) + { + e.spawned = true; + if(e.attr2<0||e.attr2>2) { conoutf("invalid ctf-flag entity (%i)", i); e.attr2 = 0; }; + flaginfo &f = flaginfos[e.attr2]; + f.flag = &e; + f.state = CTFF_INBASE; + f.originalpos.x = (float) e.x; + f.originalpos.y = (float) e.y; + f.originalpos.z = (float) e.z; + }; }; }; loopi(2) // ignore missing flags { flaginfo &f = flaginfos[i]; if(f.flag == NULL) f.flag = new entity(); - } + } ctf_team(player1->team); // ensure valid team }; diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index c1882ef5..bfc3dbd5 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -205,9 +205,12 @@ void save_world(char *mname) conoutf("wrote map file %s", (int)cgzname); settagareas(); }; + +extern void preparectf(bool cleanonly = false); void load_world(char *mname) // still supports all map formats that have existed since the earliest cube betas! -{ +{ + preparectf(true); stopifrecording(); cleardlights(); pruneundos();