umang-p / brainlets

A website for tools/utilities related to the Girls' Frontline mobile game. http://brainlets.moe
http://brainlets.moe
GNU General Public License v3.0
6 stars 12 forks source link

DPS calculation is occasionally incorrect when using "Duplicate Tab" functionality in Chrome #24

Closed AristocratMC closed 5 years ago

AristocratMC commented 5 years ago

This is a very interesting bug. Haven't debugged to see what the actual cause is, but reproduction steps are as follows:

umang-p commented 5 years ago

Fixed in the commit mentioned above.

The issue was related to when links are calculated when a doll is added to the echelon. When adding a mod3 doll, her level is set to 120 and then the element is disabled so it cannot be changed. When duplicating a tab with a mod3 doll, that doll slot would still have level 120 selected but disabled. When changeDoll was triggered by adding a new doll to the echelon, the new doll's links were being calculated before actually enabling/disabling the option elements as appropriate and selecting the correct default level value. This caused the doll added to that slot in the new instance to have only 1 link because in getNumLinks the .doll-level-select value could not be obtained because it seems jQuery does not let you read values of a disabled option element.

Fix was to just move the line where links are calculated to be after the section where the level select is changed, as it should have always been.

Thank you for reporting this.