Added some debug logging, Character.Revive removes the existing AITarget from the character before creating a new one

This commit is contained in:
Joonas Rikkonen
2018-02-26 18:05:03 +02:00
parent 1c68d5a4d7
commit 77940fa992
4 changed files with 16 additions and 0 deletions

View File

@@ -17,8 +17,13 @@ namespace Barotrauma
var entity = FindEntityByID(entityId);
if (entity != null)
{
DebugConsole.Log("Received entity removal message for \"" + entity.ToString() + "\".");
entity.Remove();
}
else
{
DebugConsole.Log("Received entity removal message for ID " + entityId + ". Entity with a matching ID not found.");
}
}
else
{

View File

@@ -1957,6 +1957,10 @@ namespace Barotrauma
{
isDead = false;
if (aiTarget != null)
{
aiTarget.Remove();
}
aiTarget = new AITarget(this);
Health = Math.Max(maxHealth * 0.1f, health);

View File

@@ -384,6 +384,11 @@ namespace Barotrauma.Items.Components
public void ServerWrite(NetBuffer msg, Client c, object[] extraData = null)
{
if (!attachable)
{
DebugConsole.ThrowError("Sent an attachment event for an item that's not attachable.");
}
msg.Write(Attached);
}

View File

@@ -1555,6 +1555,8 @@ namespace Barotrauma
ushort inventoryId = msg.ReadUInt16();
DebugConsole.Log("Received entity spawn message for item " + itemName + ".");
Vector2 pos = Vector2.Zero;
Submarine sub = null;
int inventorySlotIndex = -1;