Unit ServerOrSingle_CreatePlayerUnit(PlayerManager.ServerOrSingle_Player player,
SpawnPoint spawnPoint)
{
string unitTypeName;
if (!player.Bot)
{
unitTypeName = "Forklift";
}
else
{
unitTypeName = player.Name;
}
Unit unit = (Unit)Entities.Instance.Create(unitTypeName, Map.Instance);
Vec3 posOffset = new Vec3(0, 0, 1.5f); //!!!!temp
unit.Position = spawnPoint.Position + posOffset;
unit.Rotation = spawnPoint.Rotation;
unit.PostCreate();
if (player.Intellect != null)
{
player.Intellect.ControlledObject = unit;
unit.SetIntellect(player.Intellect, false);
}
return(unit);
}