Junkkah / Auto_battler

Python game project for a single-player auto battler
0 stars 0 forks source link

create_talent_sample incorrect return values #11

Closed Junkkah closed 8 months ago

Junkkah commented 8 months ago

LevelUp class method create_talent_sample should return dataframe that contains two valid talents for hero to choose from. The method uses various conditions to filter out talents that are not viable. Talent requirements and minimum level checking seem to be working. The method fails to discard the sample if one of the talents is already in hero's talent list.

Junkkah commented 8 months ago

Cause of issue was incorrect use of continue. Some conditions used for loop to check validity of sample. Continue keywords in the method were intended to end current iteration of while loop and reset the sample. Instead, continue ended the for loop and current sample was returned. Method now uses discard_sample boolean to reset while loop if conditions are met.