Logging when players attach items on walls or detach them, null exception fix in Throwable (picker is set to null in Item.Drop)
This commit is contained in:
@@ -191,7 +191,7 @@ namespace Barotrauma.Items.Components
|
||||
item.body.Enabled = true;
|
||||
IsActive = true;
|
||||
|
||||
if (!alreadySelected) Networking.GameServer.Log(character.Name + " equipped " + item.Name, Networking.ServerLog.MessageType.ItemInteraction);
|
||||
if (!alreadySelected) GameServer.Log(character.Name + " equipped " + item.Name, ServerLog.MessageType.ItemInteraction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
picker.DeselectItem(item);
|
||||
|
||||
Networking.GameServer.Log(character.Name + " unequipped " + item.Name, Networking.ServerLog.MessageType.ItemInteraction);
|
||||
GameServer.Log(character.Name + " unequipped " + item.Name, ServerLog.MessageType.ItemInteraction);
|
||||
|
||||
item.body.Enabled = false;
|
||||
IsActive = false;
|
||||
@@ -234,6 +234,10 @@ namespace Barotrauma.Items.Components
|
||||
if (GameMain.Server != null && attachable)
|
||||
{
|
||||
item.CreateServerEvent(this);
|
||||
if (picker != null)
|
||||
{
|
||||
Networking.GameServer.Log(picker.Name + " detached " + item.Name + " from a wall", ServerLog.MessageType.ItemInteraction);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -284,9 +288,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (!character.IsKeyDown(InputType.Aim)) return false;
|
||||
if (character.CurrentHull == null) return false;
|
||||
if (character != null && GameMain.Server != null)
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
item.CreateServerEvent(this);
|
||||
GameServer.Log(character.Name + " attached " + item.Name+" to a wall", ServerLog.MessageType.ItemInteraction);
|
||||
}
|
||||
item.Drop();
|
||||
}
|
||||
|
||||
@@ -93,11 +93,11 @@ namespace Barotrauma.Items.Components
|
||||
Vector2 throwVector = picker.CursorWorldPosition - picker.WorldPosition;
|
||||
throwVector = Vector2.Normalize(throwVector);
|
||||
|
||||
GameServer.Log(picker.Name + " threw " + item.Name, ServerLog.MessageType.ItemInteraction);
|
||||
|
||||
item.Drop();
|
||||
item.body.ApplyLinearImpulse(throwVector * throwForce * item.body.Mass * 3.0f);
|
||||
|
||||
GameServer.Log(picker.Name + " threw " + item.Name, ServerLog.MessageType.ItemInteraction);
|
||||
|
||||
ac.GetLimb(LimbType.Head).body.ApplyLinearImpulse(throwVector*10.0f);
|
||||
ac.GetLimb(LimbType.Torso).body.ApplyLinearImpulse(throwVector * 10.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user