fix: Eliminates double lookup with Contains->Remove (#2539)
This commit is contained in:
parent
e12cc5dd83
commit
8d88ef70fd
12 changed files with 25 additions and 80 deletions
|
|
@ -252,11 +252,7 @@ public abstract class BaseFactionTrap : BaseTrap
|
|||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if (Faction?.Traps.Contains(this) == true)
|
||||
{
|
||||
Faction.Traps.Remove(this);
|
||||
}
|
||||
|
||||
Faction?.Traps.Remove(this);
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
|
|
@ -286,4 +282,4 @@ public abstract class BaseFactionTrap : BaseTrap
|
|||
|
||||
return faction != Faction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue