Closed VedVid closed 5 years ago
In utilities_math:
Changing range to "normal" iteration didn't help.
Dereferencing items didn't help.
But - it's interesting. It looks like that it doesn't crash automatically. Maybe after equipping, menu stays (but it should not), and pressing key again is the source of crash?
I can confirm that, after exiting menu after first try, weapon is equipped and is removed from inventory. So, the problem is remaing menu and therefore possibility of wrong input.
PrintMenu is executed at the end and remains here, and I'm not sure why.
Current flow is, after dequipping weapon:
EquippablesMenu PrintEquippables PrintMenu (...so, we are calling equippables menu, that - via prin equippables - prepares data, then passes it to print menu. game waits for player input) HandleEquippables (handles player input, calls \/) EquipItem (so, item is equipped; now, game should go back to previous menu...) PrintEquippables (and it's true, it prints equippables again; but data for printing remains the same, while slice changed) PrintMenu (menu with equippables is printed)
Latest affected commit: b947ef24e5affe7fcb6604f90e19e5b919c7ffcb
Fixed in d2db8bcd433ae100540dd31ec1d5d946de7e4946 by adding missing "break" statement
FindObjectIndex
inutilities_math.go
andEquipItem
inmonsters.go