What you see
- A map that worked on 2.0 does not load on 3.0.x, or returns to the menu.
- Saving it in the editor shows a pjass or JassHelper error that a name is defined twice.
- Code written for 3.0.0 later fails with an undeclared function for names such as
GetEquippedItem.
Symbol IsItemEquipped multiply defined
Why it happens
Patch 3.0.0 added natives to common.j with plain names such as IsItemEquipped, GetItemTag and UnitEquipItem. Any map that already had its own function or global with one of those names now collides with the game's, and the script no longer compiles.
Patch 3.0.1 then added Blz-prefixed versions of the same natives and announced that the plain names will be removed, without a date. Code that adopted the plain names will break again when they go.
The game also refuses to start a script that declares a native it does not have.
How to fix it
- Rename the map's own function, for example
IsItemEquippedtoMyMap_IsItemEquipped, and every call to it. - In code that uses the new natives, switch to their
Blznames. - Compile against the target build's own
common.jandBlizzard.jwith pjass before you publish. - Library authors: prefix public names so the next patch cannot collide with them.
How WC3 Map Doctor detects it
- ErrorsThe map declares a function with the same name as a native added in 3.0.0, so it fails to compile or load.BRK-native-name-clash · auto-fix:
native-clash-rename - ErrorsA function, global or local in the map has the name of a native in the target build's prelude.BRK-prelude-name-clash
- WarningsThe call uses an unprefixed 3.0.0 native whose removal is announced, so the map stops compiling once it goes.BRK-unprefixed-300-call · auto-fix:
blz-301-rename - Errorspjass rejects the script against this build's common.j and Blizzard.j, so the map does not compile.GATE-pjass
Operations that fix it on a copy
- fix.doctor Apply the map doctor's targeted fixes
fix.doctor renames a clashing function to MD_ plus its name and updates every call. It refuses when the name also appears inside a string. The example report shows this exact fix.
Sources
Written in our own words from our lab notes; these are the pages behind them.