Skip to content

Tank(s) reduction are not accounted for#12

Open
peblpebl wants to merge 1 commit intoGaiaByte:masterfrom
peblpebl:patch-2
Open

Tank(s) reduction are not accounted for#12
peblpebl wants to merge 1 commit intoGaiaByte:masterfrom
peblpebl:patch-2

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