• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Hash fail?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
For some reason the trigger fires even though the dying unit (filtering unit is not FIRE_TYPE, its really weird. Ah damn GetFilterUnit() was the issue.

JASS:
static method create takes unit target, real dpsMax returns Fire 
            local real x = GetUnitX(target)
            local real y = GetUnitY(target)
            local thistype f = .allocate()
            set f.u = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), FIRE_TYPE, x, y, 0)
            set f.target = target
            set f.dpsMax = dpsMax
            call SaveInteger(hash, GetHandleId(f.u), 1, GetUnitUserData(target))
            call SetWidgetLife(f.u, GetUnitState(f.u, UNIT_STATE_MAX_LIFE)*FIRE_START_HEALTH) 
            //call SetUnitState(f.u, UNIT_STATE_LIFE, GetUnitState(f.u, UNIT_STATE_MAX_LIFE)*FIRE_START_HEALTH  )
            call f.checkState()
            return f
        endmethod


    private function OnDeath takes nothing returns boolean
        local unit u = GetFilterUnit()
        if GetUnitTypeId(u) == FIRE_TYPE then
            call BJDebugMsg("lol")
            call fire[LoadInteger(hash, GetHandleId(u), 1)].destroy() 
        endif
        return false
    endfunction
 
Status
Not open for further replies.
Top