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:
Regalis
2017-04-12 23:47:26 +03:00
parent f4c01f68ed
commit 1bd856b7a5

View File

@@ -2289,6 +2289,8 @@ namespace Barotrauma
if (GameMain.Server == null) return;
int index = components.IndexOf(ic);
if (index == -1) return;
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
}
@@ -2297,6 +2299,8 @@ namespace Barotrauma
if (GameMain.Client == null) return;
int index = components.IndexOf(ic);
if (index == -1) return;
GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
}