ItemComponent update events aren't created if the component isn't found in the item's component list (may happen if an event is created when setting a property of a component during initialization)
This commit is contained in:
@@ -2289,6 +2289,8 @@ namespace Barotrauma
|
|||||||
if (GameMain.Server == null) return;
|
if (GameMain.Server == null) return;
|
||||||
|
|
||||||
int index = components.IndexOf(ic);
|
int index = components.IndexOf(ic);
|
||||||
|
if (index == -1) return;
|
||||||
|
|
||||||
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
|
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2297,6 +2299,8 @@ namespace Barotrauma
|
|||||||
if (GameMain.Client == null) return;
|
if (GameMain.Client == null) return;
|
||||||
|
|
||||||
int index = components.IndexOf(ic);
|
int index = components.IndexOf(ic);
|
||||||
|
if (index == -1) return;
|
||||||
|
|
||||||
GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
|
GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user