Changes between Initial Version and Version 1 of Ticket #1910, comment 10


Ignore:
Timestamp:
Oct 4, 2016, 8:44:33 PM (8 years ago)
Author:
Mate-86

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1910, comment 10

    initial v1  
    11I wanted to provide a similar solution like the splash damage of ranged attack (eg. onager) but the existing solution for that does not work for when I created a test map. I've checked the code and found these:
    22
    3 1) simulation/components/Damage.js:90 says "let playersToDamage = !data.friendlyFire ? QueryPlayerIDInterface(data.attackerOwner).GetEnemies() : null;" but data.friendlyFire is always true because the string "false" is assigned to it and non-empty strings are interpreted as boolean "true"
    4 2) The same line says if the friendlyFire == true then the playersToDamage = null but this is wrong because Damage.js:241-242 says "if (!origin || !radius || !players) return [];". Which means the players should not be null.
     31) simulation/components/Damage.js:90 says {{{let playersToDamage = !data.friendlyFire ? QueryPlayerIDInterface(data.attackerOwner).GetEnemies() : null;}}} but {{{data.friendlyFire}}} is always true because the string "false" is assigned to it from the template and non-empty strings are interpreted as boolean "true"
     42) The same line says if the {{{friendlyFire == true}}} then {{{playersToDamage = null}}} but this is wrong because Damage.js:241-242 says {{{if (!origin || !radius || !players) return [];}}}. Which means the players should not be null.
    55Could you please confirm if I understood the problem correctly? Shall I fix this issue in my patch #1910?