Salvage expeditions (#12745)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user