(6e187d247) Fixed contained items' status effects being added twice to the list of an ItemContainer's active status effects when swapping items. For example, when swapping a fuel rod with another one, the status effect that increases AvailableFuel would be applied twice, causing the reactor to act as if there were 2 rods in it. Closes #1643 + merge fix
This commit is contained in:
@@ -61,6 +61,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
localEnabled = box.Selected;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -145,16 +146,12 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (obj is WhiteListedPlayer)
|
||||
{
|
||||
WhiteListedPlayer wlp = obj as WhiteListedPlayer;
|
||||
if (wlp == null) return false;
|
||||
|
||||
if (!(obj is WhiteListedPlayer wlp)) return false;
|
||||
if (!localRemoved.Contains(wlp.UniqueIdentifier)) localRemoved.Add(wlp.UniqueIdentifier);
|
||||
}
|
||||
else if (obj is LocalAdded)
|
||||
{
|
||||
LocalAdded lad = obj as LocalAdded;
|
||||
if (lad == null) return false;
|
||||
|
||||
if (!(obj is LocalAdded lad)) return false;
|
||||
if (localAdded.Contains(lad)) localAdded.Remove(lad);
|
||||
}
|
||||
|
||||
@@ -210,7 +207,6 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
ip = "IP concealed by host";
|
||||
}
|
||||
DebugConsole.NewMessage("nerd: " + name, Color.Lime);
|
||||
whitelistedPlayers.Add(new WhiteListedPlayer(name, uniqueIdentifier, ip));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user