diff --git a/config/opt/convmap.cfg b/config/opt/convmap.cfg index d9dbce68..a19c0fbe 100644 --- a/config/opt/convmap.cfg +++ b/config/opt/convmap.cfg @@ -24,7 +24,7 @@ if $execnumargs [ looplist "convmaplist m t" i [ tempalias $i ] looplisti [ CMASTAGE CMAFIRSTERROR CMALASTERROR CMACOMMENT CMANUM ] n [ tempalias $n $i ] -tempalias cmstagenames [ NOP MAPCONFIG TRANSCLIP CLEANSLOTS FIXUNASSIGNEDS FIXBADENTS MANUALERRORS MANUALEDITING ] +tempalias cmstagenames [ NOP MAPCONFIG TRANSCLIP CLEANSLOTS FIXUNASSIGNEDS FIXBADENTS MANUALERRORS MANUALEDITING FIXPICKUPFHF ] if (checkalias uncliptagclippedmodels) [ cmstagenames = (concat $cmstagenames REDUCECLIPS) ] tempalias NUMSTAGES (listlen $cmstagenames) looplisti $cmstagenames n [ tempalias $n $i ] @@ -419,6 +419,28 @@ if (! (checkalias cmcur)) [ // execute this only once duplicateclippedslots_cleanup ] + const cm_dostage_FIXPICKUPFHF [ // pause on maps with entities with pickups elevated by unnecessary heightfields + looplist [pistol ammobox grenades health helmet armour akimbo] ent [ + looplist (enumentities $ent) i [ + push entinfo (editentity $i) + select (at $entinfo 1) (at $entinfo 2) 2 2 + push v 0 + selectionwalk [ + if (|| $sw_rel_x $sw_rel_y) [ + if (|| (= $sw_type 2) (!= $sw_vdelta $v)) [ v = 0 ] // if FHF around or different vdelta: not just an elevated model + ][ + if (= $sw_type 2) [ v = $sw_vdelta ] // FHF below pickup + ] + ] + if (&& $v (! (&b $v 3))) [ // only mark elevations by whole cube sizes + addtodoentity $i "pickup entity elevated old-style, use attr1 instead" + abort = 1 + ] + pop v entinfo + ] + ] + ] + const cmfixmapmodelpaths [ push cnt 0 push ispre12 0 diff --git a/packages/maps/dev_arid.cgz b/packages/maps/dev_arid.cgz index b48637e1..86e180cc 100644 Binary files a/packages/maps/dev_arid.cgz and b/packages/maps/dev_arid.cgz differ diff --git a/packages/maps/dev_cavern.cgz b/packages/maps/dev_cavern.cgz index e8183633..b6f58715 100644 Binary files a/packages/maps/dev_cavern.cgz and b/packages/maps/dev_cavern.cgz differ diff --git a/packages/maps/dev_desert3.cgz b/packages/maps/dev_desert3.cgz index 571a0d0e..c8cfe21d 100644 Binary files a/packages/maps/dev_desert3.cgz and b/packages/maps/dev_desert3.cgz differ diff --git a/packages/maps/dev_gothic.cgz b/packages/maps/dev_gothic.cgz index 29eddb78..125b9f5c 100644 Binary files a/packages/maps/dev_gothic.cgz and b/packages/maps/dev_gothic.cgz differ diff --git a/packages/maps/dev_iceroad.cgz b/packages/maps/dev_iceroad.cgz index 72fc5c51..9bcf6115 100644 Binary files a/packages/maps/dev_iceroad.cgz and b/packages/maps/dev_iceroad.cgz differ diff --git a/packages/maps/dev_industrial.cgz b/packages/maps/dev_industrial.cgz index 9da3b000..a05fbe54 100644 Binary files a/packages/maps/dev_industrial.cgz and b/packages/maps/dev_industrial.cgz differ diff --git a/packages/maps/dev_keller.cgz b/packages/maps/dev_keller.cgz index 1b325ec7..a262ed22 100644 Binary files a/packages/maps/dev_keller.cgz and b/packages/maps/dev_keller.cgz differ diff --git a/packages/maps/dev_lainio.cgz b/packages/maps/dev_lainio.cgz index 6450442f..a43ae0dc 100644 Binary files a/packages/maps/dev_lainio.cgz and b/packages/maps/dev_lainio.cgz differ diff --git a/packages/maps/dev_outpost.cgz b/packages/maps/dev_outpost.cgz index f6a478c3..3afbac8a 100644 Binary files a/packages/maps/dev_outpost.cgz and b/packages/maps/dev_outpost.cgz differ diff --git a/packages/maps/dev_scaffold.cgz b/packages/maps/dev_scaffold.cgz index 206a3f7c..78f07a6f 100644 Binary files a/packages/maps/dev_scaffold.cgz and b/packages/maps/dev_scaffold.cgz differ diff --git a/packages/maps/dev_shine.cgz b/packages/maps/dev_shine.cgz index d7a0e360..cdf959da 100644 Binary files a/packages/maps/dev_shine.cgz and b/packages/maps/dev_shine.cgz differ diff --git a/packages/maps/dev_snow.cgz b/packages/maps/dev_snow.cgz index d09c911b..8efc5843 100644 Binary files a/packages/maps/dev_snow.cgz and b/packages/maps/dev_snow.cgz differ diff --git a/packages/maps/dev_sunset.cgz b/packages/maps/dev_sunset.cgz index 26ec0cf2..d7ca0b33 100644 Binary files a/packages/maps/dev_sunset.cgz and b/packages/maps/dev_sunset.cgz differ diff --git a/packages/maps/dev_urban.cgz b/packages/maps/dev_urban.cgz index 49677abc..42a89e08 100644 Binary files a/packages/maps/dev_urban.cgz and b/packages/maps/dev_urban.cgz differ diff --git a/packages/maps/dev_venison.cgz b/packages/maps/dev_venison.cgz index 2502d839..7a0b442d 100644 Binary files a/packages/maps/dev_venison.cgz and b/packages/maps/dev_venison.cgz differ diff --git a/packages/maps/dev_wasteland.cgz b/packages/maps/dev_wasteland.cgz index 19343e69..e2edb27a 100644 Binary files a/packages/maps/dev_wasteland.cgz and b/packages/maps/dev_wasteland.cgz differ diff --git a/source/src/world.cpp b/source/src/world.cpp index 6277fb06..d35b7be5 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -387,7 +387,7 @@ void newentity(int index, int x, int y, int z, const char *what, float v1f, floa case LIGHT: calclight(); break; case SOUND: audiomgr.preloadmapsound(e); break; } - unsavededits++; + if(index >= 0 || type != DUMMYENT) unsavededits++; // no need to save dummies } void entset(char *what, float *a1, float *a2, float *a3, float *a4) diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index a7c0b27b..f89b0a41 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -624,7 +624,7 @@ void save_world(char *mname, bool skipoptimise, bool addcomfort) hdr.numents = 0; ASSERT(MAXENTITIES < (1 << 16)); numbered_persistent_entity npe; - loopv(ents) if(ents[i].type != NOTUSED && ents[i].type!=DUMMYENT) // omit deleted entities and dummies + loopv(ents) if(ents[i].type != NOTUSED && ents[i].type != DUMMYENT) // omit deleted entities and dummies { hdr.numents++; npe.e = ents[i]; @@ -728,7 +728,7 @@ void save_world9(char *mname) hdr.headersize = sizeof(header); hdr.timestamp = (int) time(NULL); // non-zero timestamps in format 9 can be used to identify "exported" maps hdr.numents = 0; - loopv(ents) if(ents[i].type!=NOTUSED && ents[i].type!=DUMMYENT) hdr.numents++; + loopv(ents) if(ents[i].type != NOTUSED && ents[i].type != DUMMYENT) hdr.numents++; if(hdr.numents > MAXENTITIES) { conoutf("too many map entities (%d), only %d will be written to file", hdr.numents, MAXENTITIES); @@ -745,7 +745,7 @@ void save_world9(char *mname) int ne = hdr.numents, ec = 0; loopv(ents) { - if(ents[i].type!=NOTUSED && ents[i].type!=DUMMYENT) + if(ents[i].type != NOTUSED && ents[i].type != DUMMYENT) { if(!ne--) break; persistent_entity tmp = ents[i];