Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions VMFInstanceInserter/VMFStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ private static TransformType ParseTransformType(String str)

private static String FixupName(String name, TargetNameFixupStyle fixupStyle, String targetName)
{
if (fixupStyle == TargetNameFixupStyle.None || targetName == null || name.StartsWith("@") || name.StartsWith("!"))
return name;

switch (fixupStyle) {
if (targetName == null || name.StartsWith("!")) return name;
else if (name.StartsWith("@")) return name.Substring(1);
switch (fixupStyle)
{
case TargetNameFixupStyle.Postfix:
return name + targetName;
return name + '-' + targetName;
case TargetNameFixupStyle.Prefix:
return targetName + name;
return targetName + '-' + name;
default:
return name;
}
Expand Down Expand Up @@ -368,7 +368,7 @@ private VMFStructure(VMFStructure clone, int idOffset, int nodeOffset, TargetNam
}

if (Type == VMFStructureType.Connections) {
if (fixup && fixupStyle != TargetNameFixupStyle.None && targetName != null) {
if (fixupStyle != TargetNameFixupStyle.None && targetName != null) {
String[] split = kvClone.Value.String.Split(',');
split[0] = FixupName(split[0], fixupStyle, targetName);
if (stInputsDict.ContainsKey(split[1])) {
Expand Down