public override void UpdateGeneralFromEntityBase()
{
ClassType = ClassType.Character;
string dead = Character.MovementState == MyCharacterMovementEnum.Died ? " | dead" : "";
if (string.IsNullOrEmpty(Character.DisplayName))
{
Description = "NPC";
DisplayName = Character.CharacterModel + dead;
Mass = SpaceEngineersConsts.PlayerMass; // no idea what a body weighs.
}
else
{
Description = "Player";
DisplayName = Character.DisplayName + dead;
Mass = SpaceEngineersConsts.PlayerMass;
}
if (Inventory == null)
{
var inventories = Character.ComponentContainer.GetInventory();
if (inventories.Count > 0)
{
Inventory = inventories[0];
Mass += Inventory.TotalMass;
}
else
Inventory = null;
}
}