JEschete / OpenWilds

1 stars 0 forks source link

Stat allocation not removing stat from list. #5

Closed JEschete closed 2 years ago

JEschete commented 2 years ago

removes the named stat from the string list.

stats.Remove("Charisma"); // Stats is of type List

The following is not removing the relevant stat.

int statIndex = remainingStats.IndexOf(statChoice); Console.WriteLine("Removing " + remainingStats[statIndex]); remainingStats.Remove(statIndex); // remainingStats is of type List

Using the direct value does not remove it either.

JEschete commented 2 years ago

Changed remainingStats.Remove(statIndex) --> remainingStats.Remove(statChoice) And removed two lines above it, issue solved.