Skip to content

Commit

Permalink
Fix interactables mod issue (#298)
Browse files Browse the repository at this point in the history
* Fix interactables mod issue

* Add overload back
  • Loading branch information
tristanmcpherson authored Jul 21, 2021
1 parent 23f32dc commit 1dbb5fc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R2API/ItemDrop/InteractableCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using RoR2;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace R2API.ItemDrop {

Expand All @@ -13,8 +14,6 @@ This class determines which of those subset lists are present in the current run
and therefore which interactables should be prevented from spawning.
*/

public const int PrefixLength = 3;

public readonly List<string> InvalidInteractables = new List<string>();


Expand Down Expand Up @@ -160,7 +159,7 @@ This is a list of interactables that require all subset lists to be populated to
"ShrineCleanse"
};


private static Regex IscRegex = new Regex("^isc");
/*
This function will remove isc from the interactable spawn card name, to save me typing it again everywhere.
ie. iscShrineCleanse to ShrineCleanse
Expand All @@ -169,8 +168,8 @@ public static string GetSpawnCardName(SpawnCard givenSpawnCard) {
return GetSpawnCardName(givenSpawnCard.name);
}

public static string GetSpawnCardName(string givenName) {
return givenName.Substring(PrefixLength, givenName.Length - PrefixLength);
public static string GetSpawnCardName(string spawnCardName) {
return IscRegex.Replace(spawnCardName, "");
}


Expand Down

0 comments on commit 1dbb5fc

Please sign in to comment.