[#beta-bugs] *(Reposting from the official bugs channel, since this is beta code)*Minor redu...

Issue #9716 resolved
Freehold Games Bot Account created an issue

Marked for crossposting by: torn sheet of graph paper

Message (jump):

<Zephyr0> (Reposting from the official bugs channel, since this is beta code)
Minor redundancy in logic, maybe leading to misleading behavior?
= Relevant Code =
In source file: XRL.UI.Equipment.cs
404 else 405 if( c == Keys.NumPad4 || c == Keys.NumPad6 ) 407 if (bHasCybernetics) ... 457 else 458 if ((Keyboard.vkCode == Keys.Left || c == Keys.NumPad4) && Options.GetOption("OptionPressingRightInInventoryEquips", "Yes") == "Yes")
= Problem =
The (line 458) || c == Keys.NumPad4 condition is redundant and will never be evaluated as true, since that same condition is always evaluated earlier in the else-if chain (line 405).
= Impact =
On beta Numpad4 can never be used in equipment screen to unequip equipment, given OptionPressingRightInInventoryEquips is enabled. (however left arrow key can still be used)
On stable (at a quick glance) I don't think left arrow key works either.
= Suggested Fix =
Not sure what the intended behavior is, but combining line 405 and 408 : if( (c == Keys.NumPad4 || c == Keys.NumPad6) && bHasCybernetics ) would fix the redundancy on line 458. This would allow the Numpad4 to be used to unequip equipment, UNLESS the player has cybernetics, in which case Numpad4/Numpad6 would instead be used to swap between equipment/cybernetics tabs.

= Reference =
Clever Girl seems to do this already for companion's gear management
https://github.com/Kizby/Clever-Girl/blob/1285518e08c0c3533c9692cbd06fbb8f36651182/ManageGear.cs#L190C1-L190C25

Comments (2)

  1. Log in to comment