Syncing StatusEffects applied by meleeweapons or using an item on self
This commit is contained in:
@@ -95,10 +95,18 @@ namespace Barotrauma
|
||||
int slotIndex = (int)obj;
|
||||
|
||||
if (Items[slotIndex] == null) return false;
|
||||
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
GameMain.Client.CreateEntityEvent(Items[slotIndex], new object[] { NetEntityEvent.Type.ApplyStatusEffect });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
GameMain.Server.CreateEntityEvent(Items[slotIndex], new object[] { NetEntityEvent.Type.ApplyStatusEffect, character.ID });
|
||||
}
|
||||
|
||||
//save the ID in a variable in case the statuseffect causes the item to be dropped/destroyed
|
||||
ushort itemID = Items[slotIndex].ID;
|
||||
|
||||
Items[slotIndex].ApplyStatusEffects(ActionType.OnUse, 1.0f, character);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user