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,
|
EntityManager,
|
||||||
_timing,
|
_timing,
|
||||||
_logManager,
|
_logManager,
|
||||||
_mapManager,
|
|
||||||
_prototypeManager,
|
_prototypeManager,
|
||||||
_anchorable,
|
_anchorable,
|
||||||
_biome,
|
_biome,
|
||||||
_dungeon,
|
_dungeon,
|
||||||
_metaData,
|
_metaData,
|
||||||
_transform,
|
|
||||||
_mapSystem,
|
_mapSystem,
|
||||||
station,
|
station,
|
||||||
coordinatesDisk,
|
coordinatesDisk,
|
||||||
|
|||||||
@@ -41,13 +41,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
{
|
{
|
||||||
private readonly IEntityManager _entManager;
|
private readonly IEntityManager _entManager;
|
||||||
private readonly IGameTiming _timing;
|
private readonly IGameTiming _timing;
|
||||||
private readonly IMapManager _mapManager;
|
|
||||||
private readonly IPrototypeManager _prototypeManager;
|
private readonly IPrototypeManager _prototypeManager;
|
||||||
private readonly AnchorableSystem _anchorable;
|
private readonly AnchorableSystem _anchorable;
|
||||||
private readonly BiomeSystem _biome;
|
private readonly BiomeSystem _biome;
|
||||||
private readonly DungeonSystem _dungeon;
|
private readonly DungeonSystem _dungeon;
|
||||||
private readonly MetaDataSystem _metaData;
|
private readonly MetaDataSystem _metaData;
|
||||||
private readonly SharedTransformSystem _xforms;
|
|
||||||
private readonly SharedMapSystem _map;
|
private readonly SharedMapSystem _map;
|
||||||
|
|
||||||
public readonly EntityUid Station;
|
public readonly EntityUid Station;
|
||||||
@@ -61,13 +59,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
IEntityManager entManager,
|
IEntityManager entManager,
|
||||||
IGameTiming timing,
|
IGameTiming timing,
|
||||||
ILogManager logManager,
|
ILogManager logManager,
|
||||||
IMapManager mapManager,
|
|
||||||
IPrototypeManager protoManager,
|
IPrototypeManager protoManager,
|
||||||
AnchorableSystem anchorable,
|
AnchorableSystem anchorable,
|
||||||
BiomeSystem biome,
|
BiomeSystem biome,
|
||||||
DungeonSystem dungeon,
|
DungeonSystem dungeon,
|
||||||
MetaDataSystem metaData,
|
MetaDataSystem metaData,
|
||||||
SharedTransformSystem xform,
|
|
||||||
SharedMapSystem map,
|
SharedMapSystem map,
|
||||||
EntityUid station,
|
EntityUid station,
|
||||||
EntityUid? coordinatesDisk,
|
EntityUid? coordinatesDisk,
|
||||||
@@ -76,13 +72,11 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
{
|
{
|
||||||
_entManager = entManager;
|
_entManager = entManager;
|
||||||
_timing = timing;
|
_timing = timing;
|
||||||
_mapManager = mapManager;
|
|
||||||
_prototypeManager = protoManager;
|
_prototypeManager = protoManager;
|
||||||
_anchorable = anchorable;
|
_anchorable = anchorable;
|
||||||
_biome = biome;
|
_biome = biome;
|
||||||
_dungeon = dungeon;
|
_dungeon = dungeon;
|
||||||
_metaData = metaData;
|
_metaData = metaData;
|
||||||
_xforms = xform;
|
|
||||||
_map = map;
|
_map = map;
|
||||||
Station = station;
|
Station = station;
|
||||||
CoordinatesDisk = coordinatesDisk;
|
CoordinatesDisk = coordinatesDisk;
|
||||||
@@ -157,8 +151,8 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_mapManager.DoMapInitialize(mapId);
|
_map.InitializeMap(mapId);
|
||||||
_mapManager.SetMapPaused(mapId, true);
|
_map.SetPaused(mapUid, true);
|
||||||
|
|
||||||
// Setup expedition
|
// Setup expedition
|
||||||
var expedition = _entManager.AddComponent<SalvageExpeditionComponent>(mapUid);
|
var expedition = _entManager.AddComponent<SalvageExpeditionComponent>(mapUid);
|
||||||
@@ -253,7 +247,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await SpawnRandomEntry(grid, entry, dungeon, random);
|
await SpawnRandomEntry((mapUid, grid), entry, dungeon, random);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -285,7 +279,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
_sawmill.Debug($"Spawning dungeon loot {entry.Proto}");
|
_sawmill.Debug($"Spawning dungeon loot {entry.Proto}");
|
||||||
await SpawnRandomEntry(grid, entry, dungeon, random);
|
await SpawnRandomEntry((mapUid, grid), entry, dungeon, random);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -296,7 +290,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
return true;
|
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();
|
await SuspendIfOutOfTime();
|
||||||
|
|
||||||
@@ -320,7 +314,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
|
|||||||
continue;
|
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<GhostRoleComponent>(uid);
|
||||||
_entManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
|
_entManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user