Syncing StatusEffects applied by meleeweapons or using an item on self

This commit is contained in:
Regalis
2017-01-15 14:49:15 +02:00
parent f7ac98ab5f
commit 8f50cca026
4 changed files with 52 additions and 22 deletions
+11 -3
View File
@@ -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;