• 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.

[vJASS] Strangest bug I've ever seen (with UnitIndexer)

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
Weird bug with spellbook / upgrade

I'm having the strangest bug, and I'm totally stuck because of this bug.

A unit, with some kind of HP(%) upgrade that's level 3+, has a disabled spellbook with an evasion ability added, the unit will instantly die.
I came across this bug after about a month trying to figure out what was causing strange bugs in my map.

There seems to be other side effects too, which are just as strange.
(if the HP(%) upgrade was below level 3, and if the unit was removed by 'RemoveUnit' function some time in future,
the unit is considered 'dead' but it still attacks in a transparent, invulnerable state!)

JASS:
struct Test extends array

    private method index takes nothing returns nothing
        call UnitAddAbility(.unit, 'Aspb')
    endmethod
    
    private static method periodic takes nothing returns nothing
        call CreateUnit(Player(11), 'hfoo', 0, 0, 0)
    endmethod
    
    private static method onInit takes nothing returns nothing
        call FogEnable(false)
        call FogMaskEnable(false)
        
        call TimerStart(CreateTimer(), 5, true, function thistype.periodic)
        call SetPlayerAbilityAvailable(Player(11), 'Aspb', false)
        call SetPlayerTechResearched(Player(11), 'Rhar', 3)
    endmethod
    
    implement UnitIndexStruct
endstruct

Yes, the above conditions have to be met for this to happen.
I've even attached a test map for anyone curious.
 

Attachments

  • Unit Indexer.w3x
    21.5 KB · Views: 120
Last edited:
Status
Not open for further replies.
Top