Visual Mode: the effect of slope things are now only applied if they are specified in the game configuration

This commit is contained in:
biwa 2023-10-21 16:11:35 +02:00
parent 807df65279
commit 728eea84b2
2 changed files with 25 additions and 17 deletions

View file

@ -313,6 +313,7 @@ namespace CodeImp.DoomBuilder.Config
public List<FlagTranslation> ThingFlagsTranslation { get { return thingflagstranslation; } }
public Dictionary<string, ThingFlagsCompareGroup> ThingFlagsCompare { get { return thingflagscompare; } } //mxd
public Dictionary<string, string> ThingRenderStyles { get { return thingrenderstyles; } } //mxd
public IReadOnlyDictionary<int, ThingTypeInfo> ThingTypes { get { return things; } }
// Linedefs
public IDictionary<string, string> LinedefFlags { get { return linedefflags; } }

View file

@ -1154,20 +1154,22 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Find interesting things (such as sector slopes)
// Pass one of slope things, and determine which one are for pass two
//TODO: rewrite using classnames instead of numbers
foreach (Thing t in General.Map.Map.Things)
{
switch (t.Type)
if (!General.Map.Config.ThingTypes.ContainsKey(t.Type))
continue;
switch (General.Map.Config.ThingTypes[t.Type].ClassName.ToLowerInvariant())
{
// ========== Copy slope ==========
case 9511:
case 9510:
case "$copyfloorplane": // 9511
case "$copyceilingplane": // 9510
slopethingpass[1].Add(t);
break;
// ========== Thing line slope ==========
case 9501:
case 9500:
case "$slopeceilingpointline": // 9501
case "$slopefloorpointline": // 9500
if(linetags.ContainsKey(t.Args[0]))
{
// Only slope each sector once, even when multiple lines of the same sector are tagged. See https://github.com/jewalky/UltimateDoomBuilder/issues/491
@ -1193,8 +1195,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
break;
// ========== Thing slope ==========
case 9503:
case 9502:
case "$setceilingslope": // 9503
case "$setfloorslope": // 9502
t.DetermineSector(blockmap);
if (t.Sector != null)
{
@ -1206,14 +1208,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Pass two of slope things
//TODO: rewrite using classnames instead of numbers
foreach (Thing t in slopethingpass[1])
{
switch (t.Type)
if (!General.Map.Config.ThingTypes.ContainsKey(t.Type))
continue;
switch (General.Map.Config.ThingTypes[t.Type].ClassName.ToLowerInvariant())
{
// ========== Copy slope ==========
case 9511:
case 9510:
case "$copyceilingplane": // 9511
case "$copyfloorplane": // 9510
t.DetermineSector(blockmap);
if (t.Sector != null)
{
@ -1249,11 +1253,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
if ((Vector2D)t.Position == v.Position)
{
switch (t.Type)
{
case 1504: slopefloorthings.Add(t); break;
case 1505: slopeceilingthings.Add(t); break;
}
if (!General.Map.Config.ThingTypes.ContainsKey(t.Type))
continue;
switch (General.Map.Config.ThingTypes[t.Type].ClassName.ToLowerInvariant())
{
case "$vertexfloorz": slopefloorthings.Add(t); break; // 1504
case "$vertexceilingz": slopeceilingthings.Add(t); break; // 1505
}
}
}
}