• 🏆 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!

Casting an ability crashes the game if it has the same ID as a spellbook

Status
Not open for further replies.
Level 13
Joined
Jul 15, 2007
Messages
763
With the abundance of crashes happening, including to my own project (Orc Gladiators), i did some investigating. Only by accident did i find a cause that is probably going to be an issue for several custom games.

If a unit casts a spell (for example, Acid Bomb) and has a spellbook (hidden or not) with its base ID set to Acid Bomb, the game will crash.

The ID arbitrary as far as i know. I am 100% sure this problem/interaction did not exist before 1.30.

Attached crash map. Should be fairly self-explanatory.
 

Attachments

  • spellbook crash.w3x
    17.7 KB · Views: 33
Level 13
Joined
Jul 15, 2007
Messages
763
You sure it didnt crash before? Because it sounds just like undefined behavior

Yep. If it did then Orc Glads would have had a 100% crash rate if a certain hero was picked, as i unwittingly had a Channel based ability and a spellbook on the hero that used the Inner Fire base ID.

And obviously that's why this problem might be important; if you have 100s of Channel abilities and 20-30 spellbooks there's the real chance you've accidentally got two IDs the same.
 
Status
Not open for further replies.
Top