reorganizing code
parent
fe11421fc1
commit
ae5767e1fd
|
@ -16,10 +16,10 @@ namespace SupaLidlGame.Items
|
|||
|
||||
public int Count { get; set; } = 1;
|
||||
|
||||
public Character CharacterOwner { get; set; }
|
||||
|
||||
public bool IsOneHanded { get; set; } = false;
|
||||
|
||||
public Character CharacterOwner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if this item can directly stack with other items
|
||||
/// </summary>
|
||||
|
|
|
@ -48,12 +48,7 @@ namespace SupaLidlGame.Utils
|
|||
|
||||
public void LoadScene(PackedScene scene)
|
||||
{
|
||||
if (CurrentMap is not null)
|
||||
{
|
||||
CurrentMap.Entities.RemoveChild(CurrentPlayer);
|
||||
RemoveChild(CurrentMap);
|
||||
CurrentMap.Active = false;
|
||||
}
|
||||
GD.Print("Loading map " + scene.ResourcePath);
|
||||
|
||||
Map map;
|
||||
if (_maps.ContainsKey(scene.ResourcePath))
|
||||
|
@ -66,11 +61,17 @@ namespace SupaLidlGame.Utils
|
|||
_maps.Add(scene.ResourcePath, map);
|
||||
}
|
||||
|
||||
GD.Print("Loading " + scene.ResourcePath);
|
||||
if (CurrentMap is not null)
|
||||
{
|
||||
CurrentMap.Entities.RemoveChild(CurrentPlayer);
|
||||
RemoveChild(CurrentMap);
|
||||
CurrentMap.Active = false;
|
||||
}
|
||||
|
||||
CurrentMap = map;
|
||||
AddChild(map);
|
||||
InitTilemap(map);
|
||||
|
||||
CurrentMap = map;
|
||||
CurrentMap.Active = true;
|
||||
|
||||
if (CurrentPlayer is not null)
|
||||
|
|
Loading…
Reference in New Issue