• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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: 119
Last edited:
Status
Not open for further replies.
Top