Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.07k stars 78 forks source link

Avoid infinite loop on inventory category order setup #580

Closed Witek90 closed 3 months ago

Witek90 commented 3 months ago

Unexpected characters like whitespace in value of invCatOrder in system/GOTHIC.ini cause infinite-loop: invCatOrder=COMBAT, POTION, FOOD, ARMOR, MAGIC, RUNE, DOCS, OTHER, NONE

Try commented 3 months ago

Hi, @Witek90 and thanks for PR!

Can you please clarify, what input string causes infinite-loop on previous implementation?

Witek90 commented 3 months ago

Hi, some of my installed mods must have modified (whitespace after comma) the original input string: invCatOrder=COMBAT, POTION, FOOD, ARMOR, MAGIC, RUNE, DOCS, OTHER, NONE

Try commented 3 months ago

some of my installed mods must have modified (whitespace after comma) the original input string:

Thanks for explaining! I've pushed a more simple code to fix this problem, that will allow ,, `,\t` as separators