Skip to content

Tank(s) reduction are not accounted for #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peblpebl
Copy link
Contributor

@peblpebl peblpebl commented May 8, 2019

The code updates turndmg for a tank after evaluating all potential units in sequence, which means tankDamage for the last unit is used. So if Neil is NOT last, then tankDamage is 0, and opponent is not given enough turn dmg (potential 1000+ dmg). It is surprising that it has not been discovered before, but apparently some js engines, will not assign tankDamage if it is not used in the codeblock it is declared. The only case where it IS used is when it is not 0, and given there only is 1 tank in a line, it keeps the value until it is used for turndmg, so this hides the bug. My ff does this. I am very certain whatever js engine is used for eval tournaments does not, as it matches nearly cases where servers replay strings winner does not match what is seen in my client in FF.

Second attempt: Directly subtract the damage from dmgAfterDefense, as there often are cases where 1 hp is not accounted for, because of roundning errors.

The code updates turndmg for a tank after evaluating all potential units in sequence, which means tankDamage for the last unit is used. So if Neil is NOT last, then tankDamage is 0, and opponent is not given enough turn dmg (potential 1000+ dmg). It is surprising that it has not been discovered before, but apparently some js engines, will not assign tankDamage if it is not used in the codeblock it is declared. The only case where it IS used is when it is not 0, and given there only is 1 tank in a line, it keeps the value until it is used for turndmg, so this hides the bug. My ff does this. I am very certain whatever js engine is used for eval tournaments does not, as it matches nearly cases where servers replay strings winner does not match what is seen in my client in FF.

Second attempt: Directly subtract the damage from dmgAfterDefense, as there often are cases where 1 hp is not accounted for, because of roundning errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant