Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate ActorIDs #19530

Merged
merged 1 commit into from Jul 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Traits/World/EditorActorLayer.cs
Expand Up @@ -328,7 +328,7 @@ public void PopulateRadarSignatureCells(Actor self, List<(CPos Cell, Color Color

public EditorActorPreview this[string id]
{
get { return previews.FirstOrDefault(p => p.ID.ToLowerInvariant() == id); }
get { return previews.FirstOrDefault(p => p.ID.Equals(id, StringComparison.OrdinalIgnoreCase)); }
}
}
}
4 changes: 3 additions & 1 deletion OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs
Expand Up @@ -126,11 +126,13 @@ public ActorEditLogic(Widget widget, World world, WorldRenderer worldRenderer, D
}

// Check for duplicate actor ID
if (CurrentActor.ID.Equals(actorId, StringComparison.OrdinalIgnoreCase))
if (!CurrentActor.ID.Equals(actorId, StringComparison.OrdinalIgnoreCase))
{
if (editorActorLayer[actorId] != null)
{
nextActorIDStatus = ActorIDStatus.Duplicate;
actorIDErrorLabel.Text = "Duplicate ActorID";
actorIDErrorLabel.Visible = true;
return;
}
}
Expand Down