diff --git a/source/src/audiomanager.cpp b/source/src/audiomanager.cpp index 88c00d88..28552d1d 100644 --- a/source/src/audiomanager.cpp +++ b/source/src/audiomanager.cpp @@ -232,9 +232,9 @@ void audiomanager::soundcleanup() // destroy consuming code stopsound(); DELETEP(gamemusic); - mapsounds.setsize(0); - locations.deletecontentsp(); - gamesounds.setsize(0); + mapsounds.shrink(0); + locations.deletecontents(); + gamesounds.shrink(0); bufferpool.clear(); // kill scheduler @@ -250,13 +250,13 @@ void audiomanager::soundcleanup() void audiomanager::clearworldsounds(bool fullclean) { stopsound(); - if(fullclean) mapsounds.setsize(0); + if(fullclean) mapsounds.shrink(0); locations.deleteworldobjsounds(); } void audiomanager::mapsoundreset() { - mapsounds.setsize(0); + mapsounds.shrink(0); locations.deleteworldobjsounds(); } diff --git a/source/src/client.cpp b/source/src/client.cpp index 91623a98..423bd928 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -545,7 +545,7 @@ void gets2c() // get updates from the server cvector securemaps; -void resetsecuremaps() { securemaps.deletecontentsa(); } +void resetsecuremaps() { securemaps.deletearrays(); } void securemap(char *map) { if(map) securemaps.add(newstring(map)); } bool securemapcheck(const char *map, bool msg) { diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 8e5bf3fa..dd57fa6d 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -445,7 +445,7 @@ void addsleep_(char *msec, char *cmd) void resetsleep() { loopv(sleeps) DELETEA(sleeps[i].cmd); - sleeps.setsize(0); + sleeps.shrink(0); } COMMANDN(sleep, addsleep_, ARG_2STR); @@ -1152,7 +1152,7 @@ void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *giveadminmenu = void refreshsopmenu(void *menu, bool init) { menureset(menu); - mlines.setsize(0); + mlines.shrink(0); mlines.reserve(players.length()); loopv(players) if(players[i]) { diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index faf80a34..ae4766cf 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -604,7 +604,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) case SV_DISCSCORES: { - discscores.setsize(0); + discscores.shrink(0); int team; while((team = getint(p)) >= 0) { diff --git a/source/src/command.cpp b/source/src/command.cpp index 472df428..287f8705 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -522,7 +522,7 @@ struct completeval vector list; completeval(int type, const char *dir, const char *ext) : type(type), dir(dir && dir[0] ? newstring(dir) : NULL), ext(ext && ext[0] ? newstring(ext) : NULL) {} - ~completeval() { DELETEA(dir); DELETEA(ext); dirlist.deletecontentsa(); list.deletecontentsa(); } + ~completeval() { DELETEA(dir); DELETEA(ext); dirlist.deletearrays(); list.deletearrays(); } }; static inline bool htcmp(const completekey &x, const completekey &y) @@ -627,7 +627,7 @@ void commandcomplete(char *s) } if(init && cdata && cdata->type==COMPLETE_FILE) { - cdata->list.deletecontentsa(); + cdata->list.deletearrays(); loopv(cdata->dirlist) listfiles(cdata->dirlist[i], cdata->ext, cdata->list); } diff --git a/source/src/docs.cpp b/source/src/docs.cpp index 27425c66..f04ca614 100644 --- a/source/src/docs.cpp +++ b/source/src/docs.cpp @@ -594,7 +594,7 @@ int msectionsort(const msection *a, const msection *b) void renderdocsection(void *menu, bool init) { static vector msections; - msections.setsize(0); + msections.shrink(0); loopv(sections) { @@ -618,7 +618,7 @@ struct maction { string cmd; }; void renderdocmenu(void *menu, bool init) { static vector actions; - actions.setsize(0); + actions.shrink(0); menureset(menu); loopv(sections) { diff --git a/source/src/main.cpp b/source/src/main.cpp index c82f61c3..999e81ac 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -600,7 +600,7 @@ static void checkmousemotion(int &dx, int &dy) dx += event.motion.xrel; dy += event.motion.yrel; } - events.setsizenodelete(0); + events.setsize(0); SDL_Event event; while(SDL_PollEvent(&event)) { diff --git a/source/src/md2.h b/source/src/md2.h index 1c70122f..e28cba05 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -43,7 +43,7 @@ struct md2 : vertmodel int numvertex = *command++; bool isfan = numvertex<0; if(isfan) numvertex = -numvertex; - idxs.setsizenodelete(0); + idxs.setsize(0); loopi(numvertex) { union { int i; float f; } u, v; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 5f70e24d..3368d869 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -176,7 +176,7 @@ struct mitemmanual : mitem if(result >= 0 && oldmenu == curmenu) { menuset(NULL, false); - menustack.setsize(0); + menustack.shrink(0); } } } @@ -634,7 +634,7 @@ void newmenu(char *name, char *hotkeys, char *forwardkeys) void menureset(void *menu) { gmenu &m = *(gmenu *)menu; - m.items.deletecontentsp(); + m.items.deletecontents(); } void menumanual(void *menu, char *text, char *action, color *bgcolor, const char *desc) @@ -1002,7 +1002,7 @@ void gmenu::init() { if(dirlist) { - items.deletecontentsp(); + items.deletecontents(); cvector files; listfiles(dirlist->dir, dirlist->ext, files); files.sort(stringsort); @@ -1133,7 +1133,7 @@ void addchange(const char *desc, int type) void clearchanges(int type) { if(type!=CHANGE_GFX) return; - needsapply.setsize(0); + needsapply.shrink(0); closemenu("apply"); } @@ -1141,7 +1141,7 @@ void refreshapplymenu(void *menu, bool init) { gmenu *m = (gmenu *) menu; if(!m || (!init && needsapply.length() != m->items.length()-3)) return; - m->items.deletecontentsp(); + m->items.deletecontents(); loopv(needsapply) m->items.add(new mitemtext(m, newstring(needsapply[i]), NULL, NULL, NULL)); m->items.add(new mitemtext(m, newstring(""), NULL, NULL, NULL)); m->items.add(new mitemtext(m, newstring("Yes"), newstring("resetgl"), NULL, NULL)); diff --git a/source/src/protos.h b/source/src/protos.h index 55b1e7e1..f5adb049 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -170,7 +170,7 @@ struct gmenu DELETEA(mdl); DELETEP(dirlist); DELETEA(initaction); - items.deletecontentsp(); + items.deletecontents(); } void render(); diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp index df0d7193..c50707be 100644 --- a/source/src/rendercubes.cpp +++ b/source/src/rendercubes.cpp @@ -40,8 +40,8 @@ extern int ati_mda_bug; { \ if(hasMDA && !ati_mda_bug) glMultiDrawArrays_(type, strips.first.getbuf(), strips.count.getbuf(), strips.first.length()); \ else loopv(strips.first) glDrawArrays(type, strips.first[i], strips.count[i]); \ - strips.first.setsizenodelete(0); \ - strips.count.setsizenodelete(0); \ + strips.first.setsize(0); \ + strips.count.setsize(0); \ } void renderstripssky() @@ -202,7 +202,7 @@ void render_flat(int wtex, int x, int y, int size, int h, sqr *l1, sqr *l4, sqr && abs(ol1g-l3->g)g)b)b)r)g)b) shadowverts; static void resetshadowverts() { - shadowverts.setsizenodelete(0); + shadowverts.setsize(0); striptype = 0; } @@ -484,7 +484,7 @@ static void rendershadow_flat(int x, int y, int h) // floor quads } else // continue strip { - shadowverts.setsizenodelete(shadowverts.length()-2); + shadowverts.setsize(shadowverts.length()-2); } shadowvert(x+1, y+1, h); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 2afb55ca..6570c69b 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -92,7 +92,7 @@ void mapmodel(char *rad, char *h, char *zoff, char *snap, char *name) void mapmodelreset() { - if(execcontext==IEXC_MAPCFG) mapmodels.setsize(0); + if(execcontext==IEXC_MAPCFG) mapmodels.shrink(0); } mapmodelinfo &getmminfo(int i) { return mapmodels.inrange(i) ? mapmodels[i] : *(mapmodelinfo *)0; } @@ -167,7 +167,7 @@ static int numbatches = -1; void startmodelbatches() { numbatches = 0; - modelattached.setsizenodelete(0); + modelattached.setsize(0); } batchedmodel &addbatchedmodel(model *m) @@ -179,7 +179,7 @@ batchedmodel &addbatchedmodel(model *m) if(numbatchesbatched.setsizenodelete(0); + b->batched.setsize(0); } else b = batches.add(new modelbatch); b->m = m; diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp index d105218c..ede3751d 100644 --- a/source/src/rendertext.cpp +++ b/source/src/rendertext.cpp @@ -20,7 +20,7 @@ void newfont(char *name, char *tex, char *defaultw, char *defaulth, char *offset } f->tex = textureload(tex); - f->chars.setsize(0); + f->chars.shrink(0); f->defaultw = ATOI(defaultw); f->defaulth = ATOI(defaulth); f->offsetx = ATOI(offsetx); diff --git a/source/src/scoreboard.cpp b/source/src/scoreboard.cpp index 5d3522ef..950f0fd4 100644 --- a/source/src/scoreboard.cpp +++ b/source/src/scoreboard.cpp @@ -154,7 +154,7 @@ void renderscores(void *menu, bool init) modeline[0] = '\0'; serverline[0] = '\0'; - scorelines.setsize(0); + scorelines.shrink(0); vector scores; if(!watchingdemo) scores.add(player1); diff --git a/source/src/server.cpp b/source/src/server.cpp index 2ab62f49..50494fe6 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -155,7 +155,7 @@ bool buildworldstate() if(!packet->referenceCount) enet_packet_destroy(packet); else { ++ws.uses; packet->freeCallback = cleanworldstate; } } - c.position.setsizenodelete(0); + c.position.setsize(0); if(msize && (pkt[i].msgoff<0 || msize-pkt[i].msglen>0)) { @@ -166,7 +166,7 @@ bool buildworldstate() if(!packet->referenceCount) enet_packet_destroy(packet); else { ++ws.uses; packet->freeCallback = cleanworldstate; } } - c.messages.setsizenodelete(0); + c.messages.setsize(0); } reliablemessages = false; if(!ws.uses) @@ -511,7 +511,7 @@ static void cleardemos(int n) if(!n) { loopv(demofiles) delete[] demofiles[i].data; - demofiles.setsize(0); + demofiles.shrink(0); sendservmsg("cleared all demos"); } else if(demofiles.inrange(n-1)) @@ -944,7 +944,7 @@ void distributeteam(int team) int numsp = team == 100 ? smapstats.spawns[2] : smapstats.spawns[team]; if(!numsp) numsp = 30; // no spawns: try to distribute anyway twoint ti; - tdistrib.setsize(0); + tdistrib.shrink(0); loopv(clients) if(clients[i]->type!=ST_EMPTY) { if(team == 100 || team == clients[i]->team) @@ -954,7 +954,7 @@ void distributeteam(int team) } } tdistrib.sort(cmpscore); // random player order - sdistrib.setsize(0); + sdistrib.shrink(0); loopi(numsp) { ti.index = i; @@ -1320,7 +1320,7 @@ void serverdamage(client *target, client *actor, int damage, int gun, bool gib, actor->state.flagscore--; sendf(-1, 1, "riii", SV_FLAGCNT, actor->clientnum, actor->state.flagscore); } - target->position.setsizenodelete(0); + target->position.setsize(0); ts.state = CS_DEAD; ts.lastdeath = gamemillis; if(!suic) logline(ACLOG_INFO, "[%s] %s %s%s %s", actor->hostname, actor->name, gib ? (gun==GUN_GRENADE?"splattered":"gibbed") : "fragged", tk ? " his teammate" : "", target->name); @@ -1493,7 +1493,7 @@ void shuffleteams(int ftr = FTR_AUTOTEAM) } else { // skill sorted - shuffle.setsize(0); + shuffle.shrink(0); sums /= 4 * numplayers + 2; team = rnd(2); loopv(clients) if(clients[i]->type!=ST_EMPTY && clients[i]->isonrightmap && !team_isspect(clients[i]->team)) @@ -1601,12 +1601,12 @@ void resetserver(const char *newname, int newmode, int newtime) interm = 0; if(!laststatus) laststatus = servmillis-61*1000; lastfillup = servmillis; - sents.setsize(0); + sents.shrink(0); if(mastermode == MM_PRIVATE) { loopv(savedscores) savedscores[i].valid = false; } - else savedscores.setsize(0); + else savedscores.shrink(0); ctfreset(); nextmapname[0] = '\0'; @@ -2603,7 +2603,7 @@ void process(ENetPacket *packet, int sender, int chan) if(!cl->isonrightmap) break; if(cl->type==ST_TCPIP && (cl->state.state==CS_ALIVE || cl->state.state==CS_EDITING)) { - cl->position.setsizenodelete(0); + cl->position.setsize(0); while(curmsgposition.add(p.buf[curmsg++]); } if(maplayout && !m_demo && !m_coop) checkclientpos(cl); @@ -2644,7 +2644,7 @@ void process(ENetPacket *packet, int sender, int chan) cl->state.o[2] = zt / DMF; if(cl->type==ST_TCPIP && (cl->state.state==CS_ALIVE || cl->state.state==CS_EDITING)) { - cl->position.setsizenodelete(0); + cl->position.setsize(0); while(curmsgposition.add(p.buf[curmsg++]); } if(maplayout && !m_demo && !m_coop) checkclientpos(cl); diff --git a/source/src/server.h b/source/src/server.h index 47672d13..7468c0ed 100644 --- a/source/src/server.h +++ b/source/src/server.h @@ -239,7 +239,7 @@ struct client // server side version of "dynent" type void mapchange(bool getmap = false) { state.reset(); - events.setsizenodelete(0); + events.setsize(0); overflow = 0; timesync = false; isonrightmap = false; @@ -261,8 +261,8 @@ struct client // server side version of "dynent" type bottomRTT = ping = 9999; team = TEAM_SPECT; loopi(2) skin[i] = 0; - position.setsizenodelete(0); - messages.setsizenodelete(0); + position.setsize(0); + messages.setsize(0); isauthed = haswelcome = false; role = CR_DEFAULT; lastvotecall = 0; diff --git a/source/src/serveractions.h b/source/src/serveractions.h index 09a5b1db..1b040719 100644 --- a/source/src/serveractions.h +++ b/source/src/serveractions.h @@ -187,7 +187,7 @@ struct banaction : playeraction struct removebansaction : serveraction { - void perform() { bans.setsize(0); } + void perform() { bans.shrink(0); } removebansaction() { role = roleconf('B'); diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index 08561c2f..059f1865 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -101,8 +101,8 @@ void resolverclear() if(resolverthreads.empty()) return; SDL_LockMutex(resolvermutex); - resolverqueries.setsize(0); - resolverresults.setsize(0); + resolverqueries.shrink(0); + resolverresults.shrink(0); loopv(resolverthreads) { resolverthread &rt = resolverthreads[i]; @@ -501,13 +501,13 @@ void checkpings() { switch(query) { - #define RESETINFOLINES() si->infotexts.setsizenodelete(0); \ + #define RESETINFOLINES() si->infotexts.setsize(0); \ ucharbuf q(si->textdata, sizeof(si->textdata)) #define ADDINFOLINE(msg) si->infotexts.add((char *)si->textdata + q.length()); \ sendstring(msg, q) case EXTPING_NAMELIST: { - si->playernames.setsizenodelete(0); + si->playernames.setsize(0); ucharbuf q(si->namedata, sizeof(si->namedata)); loopi(si->numplayers) { @@ -884,7 +884,7 @@ bool assignserverfavourites() { int alxn[FC_NUM]; const char *alx[FC_NUM], *sep = " \t\n\r"; - favcattags.setsizenodelete(0); + favcattags.setsize(0); bool res = false; loopv(servers) { servers[i]->favcat = -1; servers[i]->weight = 0; } loopvj(favcats) @@ -1265,7 +1265,7 @@ bool serverinfokey(void *menu, int code, bool isdown, int unicode) void clearservers() { resolverclear(); - servers.deletecontentsp(); + servers.deletecontents(); } VARP(masterupdatefrequency, 1, 60*60, 24*60*60); diff --git a/source/src/serverfiles.h b/source/src/serverfiles.h index 005b9beb..7e1e9db0 100644 --- a/source/src/serverfiles.h +++ b/source/src/serverfiles.h @@ -243,7 +243,7 @@ struct servermaprot : serverconfigfile void read() { if(getfilesize(filename) == filelen) return; - configsets.setsize(0); + configsets.shrink(0); if(!load()) return; const char *sep = ": "; @@ -337,7 +337,7 @@ struct serveripblacklist : serverconfigfile void read() { if(getfilesize(filename) == filelen) return; - ipranges.setsize(0); + ipranges.shrink(0); if(!load()) return; iprange ir; @@ -409,11 +409,11 @@ struct servernickblacklist : serverconfigfile void destroylists() { - whitelistranges.setsizenodelete(0); + whitelistranges.setsize(0); enumeratek(whitelist, const char *, key, delete key); whitelist.clear(false); - blfraglist.deletecontentsp(); - blacklines.setsizenodelete(0); + blfraglist.deletecontents(); + blacklines.setsize(0); } void read() @@ -598,7 +598,7 @@ struct serverpasswords : serverconfigfile void read() { if(getfilesize(filename) == filelen) return; - adminpwds.setsize(staticpasses); + adminpwds.shrink(staticpasses); if(!load()) return; pwddetail c; diff --git a/source/src/soundscheduler.cpp b/source/src/soundscheduler.cpp index 5aa9310d..6c389653 100644 --- a/source/src/soundscheduler.cpp +++ b/source/src/soundscheduler.cpp @@ -53,7 +53,7 @@ void sourcescheduler::init(int numsoundchannels) void sourcescheduler::reset() { loopv(sources) sources[i]->reset(); - sources.deletecontentsp(); + sources.deletecontents(); } // returns a free sound source (channel) diff --git a/source/src/texture.cpp b/source/src/texture.cpp index dcca8758..e9bcc3f6 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -385,7 +385,7 @@ struct Slot vector slots; -void texturereset() { slots.setsizenodelete(0); } +void texturereset() { slots.setsize(0); } void texture(char *aframe, char *name) { diff --git a/source/src/tools.h b/source/src/tools.h index 1f494834..7662a503 100644 --- a/source/src/tools.h +++ b/source/src/tools.h @@ -322,33 +322,33 @@ template struct vector *this = v; } - ~vector() { setsize(0); if(buf) delete[] (uchar *)buf; } + ~vector() { shrink(0); if(buf) delete[] (uchar *)buf; } vector &operator=(const vector &v) { - setsize(0); - if(v.length() > alen) vrealloc(v.length()); + shrink(0); + if(v.length() > alen) growbuf(v.length()); loopv(v) add(v[i]); return *this; } T &add(const T &x) { - if(ulen==alen) vrealloc(ulen+1); + if(ulen==alen) growbuf(ulen+1); new (&buf[ulen]) T(x); return buf[ulen++]; } T &add() { - if(ulen==alen) vrealloc(ulen+1); + if(ulen==alen) growbuf(ulen+1); new (&buf[ulen]) T; return buf[ulen++]; } T &dup() { - if(ulen==alen) vrealloc(ulen+1); + if(ulen==alen) growbuf(ulen+1); new (&buf[ulen]) T(buf[ulen-1]); return buf[ulen++]; } @@ -365,11 +365,11 @@ template struct vector T &operator[](int i) { ASSERT(i>=0 && i= 0 && ii) drop(); } - void setsizenodelete(int i) { ASSERT(i<=ulen); ulen = i; } + void shrink(int i) { ASSERT(i<=ulen); while(ulen>i) drop(); } + void setsize(int i) { ASSERT(i<=ulen); ulen = i; } - void deletecontentsp() { while(!empty()) delete pop(); } - void deletecontentsa() { while(!empty()) delete[] pop(); } + void deletecontents() { while(!empty()) delete pop(); } + void deletearrays() { while(!empty()) delete[] pop(); } T *getbuf() { return buf; } const T *getbuf() const { return buf; } @@ -387,7 +387,7 @@ template struct vector return (T *) bsearch(key, &buf[i], n<0 ? ulen : n, sizeof(T), (int (__cdecl *)(const void *,const void *))cf); } - void vrealloc(int sz) + void growbuf(int sz) { int olen = alen; if(!alen) alen = max(MINSIZE, sz); @@ -404,7 +404,7 @@ template struct vector databuf reserve(int sz) { - if(ulen+sz > alen) vrealloc(ulen+sz); + if(ulen+sz > alen) growbuf(ulen+sz); return databuf(&buf[ulen], sz); } diff --git a/source/src/tristrip.h b/source/src/tristrip.h index dfaedae7..4bd59724 100644 --- a/source/src/tristrip.h +++ b/source/src/tristrip.h @@ -77,7 +77,7 @@ struct tristrip void findconnectivity() { hashtable edges; - nodes.setsizenodelete(0); + nodes.setsize(0); loopv(triangles) { triangle &tri = triangles[i]; @@ -109,7 +109,7 @@ struct tristrip } } } - loopi(4) connectivity[i].setsizenodelete(0); + loopi(4) connectivity[i].setsize(0); loopv(triangles) connectivity[triangles[i].numlinks()].add(i); if(dbgts) conoutf("no connections: %d", connectivity[0].length()); } diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index 38c83734..4b225124 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -316,7 +316,7 @@ struct vertmodel : model else d->prev.fr1 = -1; static vector side; - side.setsizenodelete(0); + side.setsize(0); loopi(numtris) { @@ -653,7 +653,7 @@ struct vertmodel : model virtual ~part() { DELETEA(filename); - meshes.deletecontentsp(); + meshes.deletecontents(); DELETEA(anims); DELETEA(links); DELETEA(tags); @@ -1213,7 +1213,7 @@ struct vertmodel : model ~vertmodel() { delete[] loadname; - parts.deletecontentsp(); + parts.deletecontents(); } char *name() { return loadname; } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index d9d03798..bbcab0ef 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -735,7 +735,7 @@ void grenadeent::explode() if(nadestate!=NS_ACTIVATED && nadestate!=NS_THROWED ) return; nadestate = NS_EXPLODED; static vec n(0,0,0); - hits.setsizenodelete(0); + hits.setsize(0); splash(); if(local) addmsg(SV_EXPLODE, "ri3iv", lastmillis, GUN_GRENADE, millis, // fixme @@ -993,7 +993,7 @@ bool gun::attack(vec &targ) attackphysics(from, to); - hits.setsizenodelete(0); + hits.setsize(0); raydamage(from, to, owner); attackfx(from, to, 0); @@ -1199,7 +1199,7 @@ bool knife::attack(vec &targ) to = from; to.add(unitv); - hits.setsizenodelete(0); + hits.setsize(0); raydamage(from, to, owner); attackfx(from, to, 0); sendshoot(from, to); diff --git a/source/src/world.cpp b/source/src/world.cpp index cd98419e..3bebddbe 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -464,7 +464,7 @@ bool empty_world(int factor, bool force) // main empty world creation routine setwatercolor(); loopi(sizeof(hdr.reserved)/sizeof(hdr.reserved[0])) hdr.reserved[i] = 0; loopk(3) loopi(256) hdr.texlists[k][i] = i; - ents.setsize(0); + ents.shrink(0); block b = { 8, 8, ssize-16, ssize-16 }; edittypexy(SPACE, b); } diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index deef44fe..8e06807f 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -488,7 +488,7 @@ bool load_world(char *mname) // still supports all map formats that have //else conoutf("this map works with the vanilla release"); // TODO: output the requirements into a file for easy user-retrieval & -action - needs a base-URL where we will hold the mediapacks } - ents.setsize(0); + ents.shrink(0); loopi(3) numspawn[i] = 0; loopi(2) numflagspawn[i] = 0; loopi(hdr.numents) diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index 62356abb..0c09634a 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -256,7 +256,7 @@ void adddynlight(physent *owner, const vec &o, int reach, int expire, int fade, void cleardynlights() { loopv(dlights) freeblock(dlights[i].area); - dlights.setsize(0); + dlights.shrink(0); } void removedynlights(physent *owner)