fix itemThink

This commit is contained in:
Evil Factory
2021-09-27 15:28:12 -03:00
parent ffcf220f1f
commit 2387c6c2c7
2 changed files with 2 additions and 6 deletions

View File

@@ -404,18 +404,12 @@ namespace Barotrauma.Items.Components
//called when isActive is true and condition > 0.0f
public virtual void Update(float deltaTime, Camera cam)
{
#if SERVER
GameMain.Lua.hook.Call("itemThink." + item.prefab.Identifier, new object[]{item});
#endif
ApplyStatusEffects(ActionType.OnActive, deltaTime);
}
//called when isActive is true and condition == 0.0f
public virtual void UpdateBroken(float deltaTime, Camera cam)
{
#if SERVER
GameMain.Lua.hook.Call("itemThink." + item.prefab.Identifier, new object[]{item});
#endif
#if CLIENT
StopSounds(ActionType.OnActive);
#endif

View File

@@ -1564,6 +1564,8 @@ namespace Barotrauma
aiTarget?.Update(deltaTime);
GameMain.Lua.hook.Call("itemThink." + prefab.Identifier, new object[] { this });
if (!isActive) { return; }
ApplyStatusEffects(ActionType.Always, deltaTime, character: (parentInventory as CharacterInventory)?.Owner as Character);