mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
copy list since its modified
This commit is contained in:
parent
540473d4e6
commit
b1810c413e
@ -13,12 +13,12 @@ internal class IlluminatedByMessage : QSBWorldObjectMessage<QSBLightSensor, uint
|
|||||||
|
|
||||||
public override void OnReceiveRemote()
|
public override void OnReceiveRemote()
|
||||||
{
|
{
|
||||||
foreach (var added in Data.Except(WorldObject._illuminatedBy))
|
foreach (var added in Data.Except(WorldObject._illuminatedBy).ToList())
|
||||||
{
|
{
|
||||||
WorldObject.SetIlluminated(added, true);
|
WorldObject.SetIlluminated(added, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var removed in WorldObject._illuminatedBy.Except(Data))
|
foreach (var removed in WorldObject._illuminatedBy.Except(Data).ToList())
|
||||||
{
|
{
|
||||||
WorldObject.SetIlluminated(removed, false);
|
WorldObject.SetIlluminated(removed, false);
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,12 @@ internal class PlayerIlluminatedByMessage : QSBMessage<(uint playerId, uint[] il
|
|||||||
{
|
{
|
||||||
var qsbPlayerLightSensor = QSBPlayerManager.GetPlayer(Data.playerId).QSBPlayerLightSensor;
|
var qsbPlayerLightSensor = QSBPlayerManager.GetPlayer(Data.playerId).QSBPlayerLightSensor;
|
||||||
|
|
||||||
foreach (var added in Data.illuminatedBy.Except(qsbPlayerLightSensor._illuminatedBy))
|
foreach (var added in Data.illuminatedBy.Except(qsbPlayerLightSensor._illuminatedBy).ToList())
|
||||||
{
|
{
|
||||||
qsbPlayerLightSensor.SetIlluminated(added, true);
|
qsbPlayerLightSensor.SetIlluminated(added, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var removed in qsbPlayerLightSensor._illuminatedBy.Except(Data.illuminatedBy))
|
foreach (var removed in qsbPlayerLightSensor._illuminatedBy.Except(Data.illuminatedBy).ToList())
|
||||||
{
|
{
|
||||||
qsbPlayerLightSensor.SetIlluminated(removed, false);
|
qsbPlayerLightSensor.SetIlluminated(removed, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user