Logging item throwing and which items are contained in items characters use on themselves (e.g. which meds are inside a syringe)

This commit is contained in:
Joonas Rikkonen
2017-07-09 21:52:13 +03:00
parent e0c10860ba
commit 045a48cc33
2 changed files with 16 additions and 38 deletions
@@ -1323,7 +1323,16 @@ namespace Barotrauma
ApplyStatusEffects(ActionType.OnUse, (float)Timing.Step, c.Character);
GameServer.Log(c.Character.Name + " used item " + Name, ServerLog.MessageType.ItemInteraction);
if (ContainedItems == null || ContainedItems.All(i => i == null))
{
GameServer.Log(c.Character.Name + " used item " + Name, ServerLog.MessageType.ItemInteraction);
}
else
{
GameServer.Log(
c.Character.Name + " used item " + Name + " (contained items: " + string.Join(", ", Array.FindAll(ContainedItems, i => i != null).Select(i => i.Name)) + ")",
ServerLog.MessageType.ItemInteraction);
}
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ApplyStatusEffect, ActionType.OnUse, c.Character.ID });