HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Another day another bug.

11-13-2009, 03:53 AM#1
weaaddar
Well boy howdy, here is a fun new bug :/
Collapse Zinc:
Library SomeLib
{
function B2S(boolean b)
{
     if(b) return "true";
     return "false";
}
function onInit()
{
unit u = CreateUnit(Player(0),'Hpal',0,0,0);
BJDebugMsg(B2S(UnitAddItemToSlotById(u,'rag1',9)));
BJDebugMsg(B2S(UnitAddItemToSlotById(u,'rag1',-9)));
}
Prints False, True.
Thats right the item actually gets added to the hero. Oh and it gets better, whenever you try to leave the game or remove the hero it causes the game to crash.

Whats more you can even remove the item and it still crashes on hero removal. This here is a library to prove the point.
By the way, I love anonymous functions.
Expand Zinc:
11-13-2009, 06:13 AM#2
Rising_Dusk
It's funny that it lets you "add" an item to a negative item slot. :p
11-13-2009, 07:53 AM#3
DioD
This is not bug, just like reverse on 100kmh breaking engine.
11-13-2009, 11:32 PM#4
weaaddar
I don't understand the analogy, but yeah no it is totally a bug. You should not be able to add items to negative spots. And if you do the item isn't real so you can't drop it. You can remove its memory, but when warcraft3 tries to release the memory of the hero it gets all wierded out by the negative index and crashes.
11-14-2009, 04:37 AM#5
DioD
remember slot 8191 and savegame\loadgame

stupid user == bugs.
11-14-2009, 08:56 AM#6
Troll-Brain
I don't see why using the index 8191 is stupid ...
Especially for vJass extended arrays.
Ofc only if we hadn't this stupid bug.

I had never the use of it but i think some extended item systems use this bug, but it seems only some negative slots works "properly".