Cleanup warnings in SpawnSalvageMissionJob (#36866)
* DoMapInitialize and SetMapPaused * GridTileToLocal * Formatting * Remove unused variables * Update Content.Server/Salvage/SpawnSalvageMissionJob.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -165,13 +165,11 @@ public sealed partial class SalvageSystem
|
||||
EntityManager,
|
||||
_timing,
|
||||
_logManager,
|
||||
_mapManager,
|
||||
_prototypeManager,
|
||||
_anchorable,
|
||||
_biome,
|
||||
_dungeon,
|
||||
_metaData,
|
||||
_transform,
|
||||
_mapSystem,
|
||||
station,
|
||||
coordinatesDisk,
|
||||
|
||||
@@ -41,13 +41,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
{
|
||||
private readonly IEntityManager _entManager;
|
||||
private readonly IGameTiming _timing;
|
||||
private readonly IMapManager _mapManager;
|
||||
private readonly IPrototypeManager _prototypeManager;
|
||||
private readonly AnchorableSystem _anchorable;
|
||||
private readonly BiomeSystem _biome;
|
||||
private readonly DungeonSystem _dungeon;
|
||||
private readonly MetaDataSystem _metaData;
|
||||
private readonly SharedTransformSystem _xforms;
|
||||
private readonly SharedMapSystem _map;
|
||||
|
||||
public readonly EntityUid Station;
|
||||
@@ -61,13 +59,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
IEntityManager entManager,
|
||||
IGameTiming timing,
|
||||
ILogManager logManager,
|
||||
IMapManager mapManager,
|
||||
IPrototypeManager protoManager,
|
||||
AnchorableSystem anchorable,
|
||||
BiomeSystem biome,
|
||||
DungeonSystem dungeon,
|
||||
MetaDataSystem metaData,
|
||||
SharedTransformSystem xform,
|
||||
SharedMapSystem map,
|
||||
EntityUid station,
|
||||
EntityUid? coordinatesDisk,
|
||||
@@ -76,13 +72,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
{
|
||||
_entManager = entManager;
|
||||
_timing = timing;
|
||||
_mapManager = mapManager;
|
||||
_prototypeManager = protoManager;
|
||||
_anchorable = anchorable;
|
||||
_biome = biome;
|
||||
_dungeon = dungeon;
|
||||
_metaData = metaData;
|
||||
_xforms = xform;
|
||||
_map = map;
|
||||
Station = station;
|
||||
CoordinatesDisk = coordinatesDisk;
|
||||
@@ -157,8 +151,8 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
}
|
||||
}
|
||||
|
||||
_mapManager.DoMapInitialize(mapId);
|
||||
_mapManager.SetMapPaused(mapId, true);
|
||||
_map.InitializeMap(mapId);
|
||||
_map.SetPaused(mapUid, true);
|
||||
|
||||
// Setup expedition
|
||||
var expedition = _entManager.AddComponent<SalvageExpeditionComponent>(mapUid);
|
||||
@@ -178,7 +172,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
dungeonOffset = dungeonRotation.RotateVec(dungeonOffset);
|
||||
var dungeonMod = _prototypeManager.Index<SalvageDungeonModPrototype>(mission.Dungeon);
|
||||
var dungeonConfig = _prototypeManager.Index(dungeonMod.Proto);
|
||||
var dungeons = await WaitAsyncTask(_dungeon.GenerateDungeonAsync(dungeonConfig, mapUid, grid, (Vector2i) dungeonOffset,
|
||||
var dungeons = await WaitAsyncTask(_dungeon.GenerateDungeonAsync(dungeonConfig, mapUid, grid, (Vector2i)dungeonOffset,
|
||||
_missionParams.Seed));
|
||||
|
||||
var dungeon = dungeons.First();
|
||||
@@ -253,7 +247,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
|
||||
try
|
||||
{
|
||||
await SpawnRandomEntry(grid, entry, dungeon, random);
|
||||
await SpawnRandomEntry((mapUid, grid), entry, dungeon, random);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -285,7 +279,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
break;
|
||||
|
||||
_sawmill.Debug($"Spawning dungeon loot {entry.Proto}");
|
||||
await SpawnRandomEntry(grid, entry, dungeon, random);
|
||||
await SpawnRandomEntry((mapUid, grid), entry, dungeon, random);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -296,7 +290,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task SpawnRandomEntry(MapGridComponent grid, IBudgetEntry entry, Dungeon dungeon, Random random)
|
||||
private async Task SpawnRandomEntry(Entity<MapGridComponent> grid, IBudgetEntry entry, Dungeon dungeon, Random random)
|
||||
{
|
||||
await SuspendIfOutOfTime();
|
||||
|
||||
@@ -314,13 +308,13 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
||||
{
|
||||
var tile = availableTiles.RemoveSwap(random.Next(availableTiles.Count));
|
||||
|
||||
if (!_anchorable.TileFree(grid, tile, (int) CollisionGroup.MachineLayer,
|
||||
(int) CollisionGroup.MachineLayer))
|
||||
if (!_anchorable.TileFree(grid, tile, (int)CollisionGroup.MachineLayer,
|
||||
(int)CollisionGroup.MachineLayer))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var uid = _entManager.SpawnAtPosition(entry.Proto, grid.GridTileToLocal(tile));
|
||||
var uid = _entManager.SpawnAtPosition(entry.Proto, _map.GridTileToLocal(grid, grid, tile));
|
||||
_entManager.RemoveComponent<GhostRoleComponent>(uid);
|
||||
_entManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user