diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 080391af1..947b7ffae 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -456,7 +456,11 @@ void CheckCompatibility(MapData *map) { FMD5Holder md5; FCompatValues *flags; - bool onlyparams = true; + + ii_compatflags = 0; + ii_compatflags2 = 0; + ib_compatflags = 0; + ii_compatparams = -1; // When playing Doom IWAD levels force COMPAT_SHORTTEX and COMPATF_LIGHT. // I'm not sure if the IWAD maps actually need COMPATF_LIGHT but it certainly does not hurt. @@ -465,27 +469,6 @@ void CheckCompatibility(MapData *map) { ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT; if (gameinfo.flags & GI_COMPATSTAIRS) ii_compatflags |= COMPATF_STAIRINDEX; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; - } - else if (Wads.GetLumpFile(map->lumpnum) == 1 && (gameinfo.flags & GI_COMPATPOLY1) && Wads.CheckLumpName(map->lumpnum, "MAP36")) - { - ii_compatflags = COMPATF_POLYOBJ; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; - } - else if (Wads.GetLumpFile(map->lumpnum) == 2 && (gameinfo.flags & GI_COMPATPOLY2) && Wads.CheckLumpName(map->lumpnum, "MAP47")) - { - ii_compatflags = COMPATF_POLYOBJ; - ii_compatflags2 = 0; - ib_compatflags = 0; - ii_compatparams = -1; - } - else - { - onlyparams = false; } map->GetChecksum(md5.Bytes); @@ -512,24 +495,12 @@ void CheckCompatibility(MapData *map) if (flags != NULL) { - if (!onlyparams) - { - ii_compatflags = flags->CompatFlags[SLOT_COMPAT]; - ii_compatflags2 = flags->CompatFlags[SLOT_COMPAT2]; - ib_compatflags = flags->CompatFlags[SLOT_BCOMPAT]; - } + ii_compatflags |= flags->CompatFlags[SLOT_COMPAT]; + ii_compatflags2 |= flags->CompatFlags[SLOT_COMPAT2]; + ib_compatflags |= flags->CompatFlags[SLOT_BCOMPAT]; ii_compatparams = flags->ExtCommandIndex; } - else - { - if (!onlyparams) - { - ii_compatflags = 0; - ii_compatflags2 = 0; - ib_compatflags = 0; - } - ii_compatparams = -1; - } + // Reset i_compatflags compatflags.Callback(); compatflags2.Callback(); diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 9f6c1fdce..5d42d64ba 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2555,7 +2555,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool else { auto cnst = static_cast(x); - hasdefault = true; switch (type->GetRegType()) { case REGT_INT: @@ -2583,6 +2582,8 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool break; } } + + hasdefault = true; } if (x != nullptr) delete x; } diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 173aa10d1..aafdd9a37 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -763,3 +763,9 @@ CA3773ED313E8899311F3DD0CA195A68 // e3m6 setsectorlight 138 192 setwalltexture 3431 back top BRKGRY01 } + +3FFAF2F624C1B4BB6F581DCF7B99CBA7 // hexen.wad MAP36 +7DC65D5029DD834481CD716B3D71388A // hexdd.wad MAP47 +{ + polyobj +} diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index 750296565..e7786059b 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -266,7 +266,7 @@ class Inventory : Actor native if (copy.bInitEffectFailed) { if (copy != self) copy.Destroy(); - else bInitEffectFailed; + else bInitEffectFailed = false; return false; } // Handle owner-changing powerups