chessmasterhong / WaterEmblem

https://chessmasterhong.bitbucket.io/projects/WaterEmblem/
118 stars 27 forks source link

Battle summary modal not appearing #116

Closed DrkSephy closed 9 years ago

DrkSephy commented 9 years ago

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]) {