Skip to content

Commit

Permalink
Prevent crash in extra earrings xp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno458 committed Aug 21, 2023
1 parent ce6290a commit 791e0d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TsRandomizer/Randomisation/OrbExperienceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ static void AwardOrbXpIfEnemyWasHitByOrb(Level level, Protagonist lunais, XpAwar
static void AwardOrbXp(Level level, Protagonist lunais, XpAwardingOrb orbType, int xpToAdd)
{
var orbColor = GetOrbColor(orbType, GetOrb(lunais, orbType));

if (orbColor == EInventoryOrbType.None)
return;

var inventoryOrb = level.GameSave.Inventory.OrbInventory.GetItem((int)orbColor);

Expand All @@ -147,6 +150,9 @@ static object GetOrb(Protagonist lunais, XpAwardingOrb orb)

static EInventoryOrbType GetOrbColor(XpAwardingOrb orbType, object orb)
{
if (orb == null)
return EInventoryOrbType.None;

switch (orbType)
{
case XpAwardingOrb.Main:
Expand Down

0 comments on commit 791e0d4

Please sign in to comment.