- Edited item densities to make more sense

- Characters spawned through the console are synced with clients
This commit is contained in:
Regalis
2016-03-04 18:29:41 +02:00
parent 6efb64e94d
commit 02825782e5
18 changed files with 107 additions and 57 deletions
+9 -3
View File
@@ -193,11 +193,15 @@ namespace Barotrauma
break;
case "spawn":
if (commands.Length == 1) return;
Character spawnedCharacter = null;
if (commands[1].ToLower()=="human")
{
WayPoint spawnPoint = WayPoint.GetRandom(SpawnType.Human);
Character.Controlled = Character.Create(Character.HumanConfigFile, (spawnPoint == null) ? Vector2.Zero : spawnPoint.WorldPosition);
spawnedCharacter = Character.Create(Character.HumanConfigFile, (spawnPoint == null) ? Vector2.Zero : spawnPoint.WorldPosition);
Character.Controlled = spawnedCharacter;
if (GameMain.GameSession != null)
{
SinglePlayerMode mode = GameMain.GameSession.gameMode as SinglePlayerMode;
@@ -209,9 +213,11 @@ namespace Barotrauma
else
{
WayPoint spawnPoint = WayPoint.GetRandom(SpawnType.Enemy);
Character.Create("Content/Characters/" + commands[1] + "/" + commands[1] + ".xml", (spawnPoint == null) ? Vector2.Zero : spawnPoint.WorldPosition);
spawnedCharacter = Character.Create("Content/Characters/" + commands[1] + "/" + commands[1] + ".xml", (spawnPoint == null) ? Vector2.Zero : spawnPoint.WorldPosition);
}
if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
break;
//case "startserver":
// if (Game1.Server==null)