reorganizing code

item-info
HumanoidSandvichDispenser 2023-03-26 13:03:45 -07:00
parent fe11421fc1
commit ae5767e1fd
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 11 additions and 10 deletions

View File

@ -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>

View File

@ -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)