mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Error checks mode: UDMF Thing skill flags are now also taken into account.
Some more tweaks in ZDoom_misc.cfg
This commit is contained in:
parent
88e856b6f3
commit
42368ae530
2 changed files with 31 additions and 8 deletions
|
@ -121,6 +121,14 @@ thingflagscompare_udmf
|
||||||
skill6;
|
skill6;
|
||||||
skill7;
|
skill7;
|
||||||
skill8;
|
skill8;
|
||||||
|
skill9;
|
||||||
|
skill10;
|
||||||
|
skill11;
|
||||||
|
skill12;
|
||||||
|
skill13;
|
||||||
|
skill14;
|
||||||
|
skill15;
|
||||||
|
skill16;
|
||||||
}
|
}
|
||||||
|
|
||||||
classes {
|
classes {
|
||||||
|
@ -129,6 +137,14 @@ thingflagscompare_udmf
|
||||||
class6;
|
class6;
|
||||||
class7;
|
class7;
|
||||||
class8;
|
class8;
|
||||||
|
class9;
|
||||||
|
class10;
|
||||||
|
class11;
|
||||||
|
class12;
|
||||||
|
class13;
|
||||||
|
class14;
|
||||||
|
class15;
|
||||||
|
class16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,16 +117,23 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
// 1 if the flag overlaps
|
// 1 if the flag overlaps
|
||||||
public int Compare(Thing t1, Thing t2)
|
public int Compare(Thing t1, Thing t2)
|
||||||
{
|
{
|
||||||
bool t1flag;
|
bool t1flag = false;
|
||||||
bool t2flag;
|
bool t2flag = false;
|
||||||
|
|
||||||
// Check if the flags exist
|
// Check if the flags exist
|
||||||
if (!t1.Flags.ContainsKey(flag) || !t2.Flags.ContainsKey(flag))
|
if(!t1.Flags.ContainsKey(flag) || !t2.Flags.ContainsKey(flag)) {
|
||||||
|
//mxd. If a map is in UDMF format - check Fields
|
||||||
|
if(!General.Map.UDMF || !t1.Fields.ContainsKey(flag) || !t2.Fields.ContainsKey(flag))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// tag flag inversion into account
|
||||||
|
t1flag = invert ? !(bool)t1.Fields[flag].Value : (bool)t1.Fields[flag].Value;
|
||||||
|
t2flag = invert ? !(bool)t2.Fields[flag].Value : (bool)t2.Fields[flag].Value;
|
||||||
|
} else {
|
||||||
// tag flag inversion into account
|
// tag flag inversion into account
|
||||||
t1flag = invert ? !t1.Flags[flag] : t1.Flags[flag];
|
t1flag = invert ? !t1.Flags[flag] : t1.Flags[flag];
|
||||||
t2flag = invert ? !t2.Flags[flag] : t2.Flags[flag];
|
t2flag = invert ? !t2.Flags[flag] : t2.Flags[flag];
|
||||||
|
}
|
||||||
|
|
||||||
if (comparemethod == CompareMethod.And && (t1flag && t2flag))
|
if (comparemethod == CompareMethod.And && (t1flag && t2flag))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue