When selecting a target to attack, the player hovers over an enemy unit. However, the battle summary modal showing the stats on both sides of the battle do now show up. The culprit is this section of code here:
// Draw battle summary modal on cursor hover while selecting an enemy to attack
if(this.battleState === 'attack' && this.units[this.activeUnit] === this.targetedUnit) {
// console.log("hello");
if(this.hoveredUnit !== null && this.attackTargets.length > 0) {
for(var i = 0; i < this.attackTargets.length; i++) {
// This if statement is never true
if(this.hoveredUnit === this.attackTargets[i]) {
When selecting a target to attack, the player hovers over an enemy unit. However, the battle summary modal showing the stats on both sides of the battle do now show up. The culprit is this section of code here: