RoomSpawner mask (#33110)
* RoolFill can now spaw rooms with any size * tile ignoring * upgrade interior * simplify * Update DungeonSystem.Rooms.cs * center rooms * Update RoomFillComponent.cs * Update RoomFillComponent.cs * Update DungeonSystem.Rooms.cs * Remove roomfillcoponent from integration test * Update EntityTest.cs * remove nullable size, replaced with minsize and maxsize * clear existing logic refactor * delete this one
This commit is contained in:
@@ -15,16 +15,12 @@ public sealed class RoomFillSystem : EntitySystem
|
||||
|
||||
private void OnRoomFillMapInit(EntityUid uid, RoomFillComponent component, MapInitEvent args)
|
||||
{
|
||||
// Just test things.
|
||||
if (component.Size == Vector2i.Zero)
|
||||
return;
|
||||
|
||||
var xform = Transform(uid);
|
||||
|
||||
if (xform.GridUid != null)
|
||||
{
|
||||
var random = new Random();
|
||||
var room = _dungeon.GetRoomPrototype(component.Size, random, component.RoomWhitelist);
|
||||
var room = _dungeon.GetRoomPrototype(random, component.RoomWhitelist, component.MinSize, component.MaxSize);
|
||||
|
||||
if (room != null)
|
||||
{
|
||||
@@ -32,7 +28,7 @@ public sealed class RoomFillSystem : EntitySystem
|
||||
_dungeon.SpawnRoom(
|
||||
xform.GridUid.Value,
|
||||
mapGrid,
|
||||
_maps.LocalToTile(xform.GridUid.Value, mapGrid, xform.Coordinates),
|
||||
_maps.LocalToTile(xform.GridUid.Value, mapGrid, xform.Coordinates) - new Vector2i(room.Size.X/2,room.Size.Y/2),
|
||||
room,
|
||||
random,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user