Closed sdiaz7 closed 7 years ago
Prova:
Bug was caused by the way the if-else conditions where sorted.
Old pseudocode:
if upgrade button clicked and tower selected:
upgrade selected tower
else if tower clicked:
set clicked tower as tower selected
else if sell button clicked and tower selected:
sell selected tower
else
close interface
Making the tower selection checkout before the buying tower causes that when the associated button is clicked over a tower the code takes the tower and does not perform the sale. Fixed pseudocode:
if upgrade button clicked and tower selected:
upgrade selected tower
else if sell button clicked and tower selected:
sell selected tower
else if tower clicked:
set clicked tower as tower selected
else
close interface
Now the "sell button clicked" condition has priority over the "tower clicked one". With this little modification the code works as was expected. I proceed to open the pull request
Issue done perfectly, see Pull Request #283 for more info.
Clicking the interface buttons when they are over a tower opens the interface of that tower, rather than performing the requested action.
Definition of Done:
Time estimated: 1 hour
Branch: dev_Issue282
Pull request: #283