Salvage expeditions (#12745)

This commit is contained in:
metalgearsloth
2023-04-20 10:43:13 +10:00
committed by GitHub
parent 486d7c179e
commit 122350f19c
79 changed files with 2764 additions and 662 deletions

View File

@@ -53,7 +53,7 @@ public sealed class PlanetCommand : IConsoleCommand
return;
}
if (!_protoManager.HasIndex<BiomePrototype>(args[1]))
if (!_protoManager.TryIndex<BiomeTemplatePrototype>(args[1], out var biomeTemplate))
{
shell.WriteError(Loc.GetString("cmd-planet-map-prototype", ("prototype", args[1])));
return;
@@ -63,8 +63,9 @@ public sealed class PlanetCommand : IConsoleCommand
MetaDataComponent? metadata = null;
var biome = _entManager.EnsureComponent<BiomeComponent>(mapUid);
_entManager.System<BiomeSystem>().SetPrototype(biome, args[1]);
_entManager.System<BiomeSystem>().SetSeed(biome, _random.Next());
var biomeSystem = _entManager.System<BiomeSystem>();
biomeSystem.SetSeed(biome, _random.Next());
biomeSystem.SetTemplate(biome, biomeTemplate);
_entManager.Dirty(biome);
var gravity = _entManager.EnsureComponent<GravityComponent>(mapUid);
@@ -106,7 +107,7 @@ public sealed class PlanetCommand : IConsoleCommand
if (args.Length == 2)
{
var options = _protoManager.EnumeratePrototypes<BiomePrototype>()
var options = _protoManager.EnumeratePrototypes<BiomeTemplatePrototype>()
.Select(o => new CompletionOption(o.ID, "Biome"));
return CompletionResult.FromOptions(options);
}