mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 13:15:54 +00:00
Door link fix
This commit is contained in:
parent
8c20e6f342
commit
cae1f99949
5 changed files with 86 additions and 33 deletions
|
|
@ -126,8 +126,6 @@ public partial class RogueliteRoomManager : Node2D
|
|||
break;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
_mainPath.Add(nextPos);
|
||||
|
||||
// Place cursor at bottom of room
|
||||
|
|
@ -174,10 +172,11 @@ public partial class RogueliteRoomManager : Node2D
|
|||
foreach (var roomEntry in _roomGrid)
|
||||
{
|
||||
var room = roomEntry.Value;
|
||||
room.HandleDoors(pos =>
|
||||
room.HandleDoors((doorEdge, pos) =>
|
||||
{
|
||||
var neighborPos = room.GridPosition + pos;
|
||||
return _roomGrid.ContainsKey(neighborPos);
|
||||
//var neighborPos = room.GridPosition + pos;
|
||||
return _connections.FirstOrDefault(x => (x.From == doorEdge && x.To == pos) || (x.From == pos && x.To == doorEdge));
|
||||
//return _roomGrid.ContainsKey(neighborPos);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -413,20 +412,4 @@ public partial class RogueliteRoomManager : Node2D
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RoomConnection
|
||||
{
|
||||
public Vector2I From;
|
||||
public Vector2I To;
|
||||
public bool IsLocked;
|
||||
public bool IsSecret;
|
||||
|
||||
public RoomConnection(Vector2I from, Vector2I to, bool isLocked = false, bool isSecret = false)
|
||||
{
|
||||
From = from;
|
||||
To = to;
|
||||
IsLocked = isLocked;
|
||||
IsSecret = isSecret;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue