- Edited item densities to make more sense
- Characters spawned through the console are synced with clients
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user