From 4783f4823c6aff410b40fa36b8e24f1e2ad49f40 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 22 May 2023 20:51:10 +0200 Subject: [PATCH] Thing-based vertex slopes: Pick the right mapthings --- .../VisualModes/BaseVisualMode.cs | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 743f3846..399fd7f8 100755 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -1056,13 +1056,31 @@ namespace CodeImp.DoomBuilder.BuilderModes List sourcethings = new List(); if (!thingtags.ContainsKey(l.Args[1]) || thingtags[l.Args[1]].Count == 0) break; + foreach (Thing thing in thingtags[l.Args[1]]) + { + if (sourcethings.Contains(thing)) + continue; + sourcethings.Add(thing); + break; + } if (!thingtags.ContainsKey(l.Args[2]) || thingtags[l.Args[2]].Count == 0) break; + foreach (Thing thing in thingtags[l.Args[2]]) + { + if (sourcethings.Contains(thing)) + continue; + sourcethings.Add(thing); + break; + } if (!thingtags.ContainsKey(l.Args[3]) || thingtags[l.Args[3]].Count == 0) break; - sourcethings.Add(thingtags[l.Args[1]][0]); - sourcethings.Add(thingtags[l.Args[2]][0]); - sourcethings.Add(thingtags[l.Args[3]][0]); + foreach (Thing thing in thingtags[l.Args[3]]) + { + if (sourcethings.Contains(thing)) + continue; + sourcethings.Add(thing); + break; + } SectorData sd = GetSectorData((l.Args[0] < 2) ? l.Front.Sector : l.Back.Sector); sd.AddEffectSRB2ThingVertexSlope(sourcethings, (l.Args[0] & 1) != 1); break;