Skip to content

Commit

Permalink
Fixed missing items in kittyboss and dynamo works rooms preventing pr…
Browse files Browse the repository at this point in the history
…ogression
  • Loading branch information
Jarno458 committed Jan 12, 2022
1 parent e09baff commit 9d55c32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
15 changes: 5 additions & 10 deletions TsRandomizer/LevelObjects/ItemManipulator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Timespinner.GameAbstractions.Inventory;
using Timespinner.GameObjects.BaseClasses;
using TsRandomizer.Extensions;
using TsRandomizer.IntermediateObjects;
Expand All @@ -23,14 +21,14 @@ abstract class ItemManipulator : LevelObject
{
static ItemLocationMap itemLocationMap;

public bool IsPickedUp => itemLocation.IsPickedUp;
public bool IsPickedUp => ItemLocation.IsPickedUp;

public readonly ItemInfo ItemInfo;
readonly ItemLocation itemLocation;
public readonly ItemLocation ItemLocation;

protected ItemManipulator(Mobile typedObject, ItemLocation itemLocation) : base(typedObject)
{
this.itemLocation = itemLocation;
ItemLocation = itemLocation;
ItemInfo = itemLocation?.ItemInfo;
}

Expand All @@ -47,16 +45,13 @@ protected void AwardContainedItem()
protected void OnItemPickup()
{
ItemInfo.OnPickup(Level);
itemLocation.SetPickedUp();
ItemLocation.SetPickedUp();

if (ItemInfo.IsProgression)
ItemTrackerUplink.UpdateState(ItemTrackerState.FromItemLocationMap(itemLocationMap));
}

public static void Initialize(ItemLocationMap itemLocations)
{
itemLocationMap = itemLocations;
}
public static void Initialize(ItemLocationMap itemLocations) => itemLocationMap = itemLocations;

public static ItemManipulator GenerateShadowObject(Type levelObjectType, Mobile obj, ItemLocationMap itemLocations)
{
Expand Down
4 changes: 3 additions & 1 deletion TsRandomizer/LevelObjects/ItemManipulators/OrbPedestal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ protected override void Initialize(SeedOptions options)
if (ItemInfo == null)
return;

if (IsPickedUp)
if (IsPickedUp
&& ItemLocation.Key != new RoomItemKey(1, 5) //Kitty boss
&& ItemLocation.Key != new RoomItemKey(11, 39)) //Dynamo Works
{
Level.RequestRemoveObject(TypedObject);
return;
Expand Down

0 comments on commit 9d55c32

Please sign in to comment.