1. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  2. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  3. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice

[Trigger] Need help to understand a strange death interaction

Discussion in 'Triggers & Scripts' started by Schyle, May 2, 2019.

  1. Schyle

    Schyle

    Joined:
    May 2, 2019
    Messages:
    2
    Resources:
    0
    Resources:
    0
    I came across a weird problem recently with one of the maps I am working on. Some of the spawning units died unexpectedly without any obvious cause. I have managed to locate and replicate the problem, but it still doesn't make any sense to me.

    So I hope someone else can explain to me why this trigger will kill the unit:

    Trigger:

    Events
    Player - Player 1 (Red) Presses the Down Arrow key
    Conditions
    Actions
    Player - Set the current research level of Upgrade to 1 for Player 1 (Red)
    Unit - Create 1 Dummy for Player 1 (Red) at (Center of Region 000 <gen>) facing Default building facing degrees
    Unit - Add Frostbolt (Spellbook) to (Last created unit)

    The Upgrade in this example give 500 health per rank and stack up to 10 times.

    From my understanding, this is what happens:

    If a unit have any upgrade and a spellbook with a skill in it (at the same time), then the unit is killed.

    This can be avoided if either the spellbook or the upgrade is removed, or if the trigger sequence is altered. But why is the unit killed in the first place?

    See test map for more info.
     

    Attached Files:

  2. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,243
    Resources:
    5
    Models:
    1
    Icons:
    1
    Spells:
    2
    JASS:
    1
    Resources:
    5
    Ah, the infamous spell-book upgrade bug. This bug occurs if the bonus hp granted to the unit is greater than or equal to the unit's max hp.

    If I recall, there is a thread by DracoL1ch in the Lab that addresses the probable cause behind the bug.
     
  3. Schyle

    Schyle

    Joined:
    May 2, 2019
    Messages:
    2
    Resources:
    0
    Resources:
    0
    Thanks a lot! :D

    I will try to find the thread and check it out.