Fix planet command being ran on existing maps (#21775)
This commit is contained in:
@@ -29,14 +29,15 @@ public sealed partial class BiomeSystem
|
||||
|
||||
int.TryParse(args[0], out var mapInt);
|
||||
var mapId = new MapId(mapInt);
|
||||
var mapUid = _mapManager.GetMapEntityId(mapId);
|
||||
|
||||
if (_mapManager.MapExists(mapId) ||
|
||||
!TryComp<BiomeComponent>(_mapManager.GetMapEntityId(mapId), out var biome))
|
||||
!TryComp<BiomeComponent>(mapUid, out var biome))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ClearTemplate(biome);
|
||||
ClearTemplate(mapUid, biome);
|
||||
}
|
||||
|
||||
private CompletionResult BiomeClearCallbackHelper(IConsoleShell shell, string[] args)
|
||||
@@ -63,8 +64,9 @@ public sealed partial class BiomeSystem
|
||||
}
|
||||
|
||||
var mapId = new MapId(mapInt);
|
||||
var mapUid = _mapManager.GetMapEntityId(mapId);
|
||||
|
||||
if (!_mapManager.MapExists(mapId) || !TryComp<BiomeComponent>(_mapManager.GetMapEntityId(mapId), out var biome))
|
||||
if (!_mapManager.MapExists(mapId) || !TryComp<BiomeComponent>(mapUid, out var biome))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +83,7 @@ public sealed partial class BiomeSystem
|
||||
int.TryParse(args[3], out offset);
|
||||
}
|
||||
|
||||
AddTemplate(biome, args[2], template, offset);
|
||||
AddTemplate(mapUid, biome, args[2], template, offset);
|
||||
}
|
||||
|
||||
private CompletionResult AddLayerCallbackHelp(IConsoleShell shell, string[] args)
|
||||
|
||||
Reference in New Issue
Block a user