Default flag ("playercross") was not set when a map was converted to UDMF map format (because there are no default flags in UDMF).

Linedef activation now translates a bit more accurately when converting a map to/from UDMF.
This commit is contained in:
MaxED 2013-06-05 11:12:44 +00:00
parent be3f71c2e7
commit a938453703
3 changed files with 11 additions and 4 deletions

View file

@ -77,7 +77,7 @@ linedefflags
linedefactivations
{
playercross = "When player walks over";
playercross = "When player walks over"; //mxd. The first flag is now used as default flag when translating a map to UDMF format
playeruse = "When player presses use";
monstercross = "When monster walks over";
monsteruse = "When monster presses use";

View file

@ -19,7 +19,8 @@ linedefactivations
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
6144 = "passuse";
6144 = "playeruse,passuse"; //mxd
7168 = "impact,missilecross"; //mxd
16384 = "blockplayers";
}

View file

@ -406,6 +406,10 @@ namespace CodeImp.DoomBuilder.Map
// Now make the new flags
flags.Clear();
//mxd. That's hackish...
if(action != 0 && activate == 0) flags[General.Map.Config.LinedefActivates[0].Key] = true;
foreach(FlagTranslation f in General.Map.Config.LinedefFlagsTranslation)
{
// Flag found in bits?
@ -419,8 +423,10 @@ namespace CodeImp.DoomBuilder.Map
else
{
// Add fields with inverted value
for(int i = 0; i < f.Fields.Count; i++)
flags[f.Fields[i]] = !f.FieldValues[i];
for(int i = 0; i < f.Fields.Count; i++) {
if(!flags.ContainsKey(f.Fields[i])) //mxd
flags[f.Fields[i]] = !f.FieldValues[i];
}
}
}