Load grid error related changes (#10817)
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
private const string ObserverPrototypeName = "MobObserver";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), Obsolete("Due for removal when observer spawning is refactored.")]
|
||||
[ViewVariables(VVAccess.ReadWrite), Obsolete("Due for removal when observer spawning is refactored.")] // See also: MindComponent's OnShutdown shitcode
|
||||
private EntityCoordinates _spawnPoint;
|
||||
|
||||
/// <summary>
|
||||
@@ -280,7 +280,11 @@ namespace Content.Server.GameTicking
|
||||
#region Spawn Points
|
||||
public EntityCoordinates GetObserverSpawnPoint()
|
||||
{
|
||||
var location = _spawnPoint;
|
||||
// TODO rename this to TryGetObserverSpawnPoint to make it clear that the result might be invalid. Or at
|
||||
// least try try more fallback values, like randomly spawning them in any available map or just creating a
|
||||
// "we fucked up" map. Its better than dumping them into the void.
|
||||
|
||||
var location = _spawnPoint.IsValid(EntityManager) ? _spawnPoint : EntityCoordinates.Invalid;
|
||||
|
||||
_possiblePositions.Clear();
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
var shuttlePath = "/Maps/infiltrator.yml";
|
||||
var mapId = _mapManager.CreateMap();
|
||||
|
||||
var (_, outpost) = _mapLoader.LoadBlueprint(mapId, "/Maps/nukieplanet.yml");
|
||||
var (_, outpost) = _mapLoader.LoadGrid(mapId, "/Maps/nukieplanet.yml");
|
||||
|
||||
if (outpost == null)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
}
|
||||
|
||||
// Listen I just don't want it to overlap.
|
||||
var (_, shuttleId) = _mapLoader.LoadBlueprint(mapId, shuttlePath, new MapLoadOptions()
|
||||
var (_, shuttleId) = _mapLoader.LoadGrid(mapId, shuttlePath, new MapLoadOptions()
|
||||
{
|
||||
Offset = Vector2.One * 1000f,
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ public sealed class PiratesRuleSystem : GameRuleSystem
|
||||
aabb.Union(aabbs[i]);
|
||||
}
|
||||
|
||||
var (_, gridId) = _mapLoader.LoadBlueprint(GameTicker.DefaultMap, map, new MapLoadOptions
|
||||
var (_, gridId) = _mapLoader.LoadGrid(GameTicker.DefaultMap, map, new MapLoadOptions
|
||||
{
|
||||
Offset = aabb.Center + MathF.Max(aabb.Height / 2f, aabb.Width / 2f) * 2.5f
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user