Weird MySQL error with #spawn/#npcspawn create
I got the latest code from Github and compiled and copied over, and decided to try out #spawn and #npcspawn create and #npcedit, but I am getting the oddest error when using #spawn and #npcspawn create.
I'll make a hotkey or manually type out the #spawn command:
Quote:
#spawn WoodElf 4 25 0 - 1 0 0 0 0 1
|
Then manually type out:
And I'll get the following error in red in my chat window:
Quote:
08-01-2015 :: 17:41:11] [MySQL Error] 1264: Out of range value for column 'sec_melee_type' at row 1
INSERT INTO npc_types (name, level, race, class, hp, gender, texture, helmtexture, size, loottable_id, merchant_id, face, runspeed, prim_melee_type, sec_melee_type) VALUES("WoodElf", 25, 4, 0, 723, 1, 0, 0, 0.000000, 0, 0, 0, 0.000000, 28, -1508384059)
|
The last value is for a byte, and should be 28 like prim_melee_type, and not just because it's in the spawn struct that way, but because it's actually been -hard coded- that way:
Quote:
zone/npc.cpp - Line 1059-1066
query = StringFormat("INSERT INTO npc_types (name, level, race, class, hp, gender, "
"texture, helmtexture, size, loottable_id, merchant_id, face, "
"runspeed, prim_melee_type, sec_melee_type) "
"VALUES(\"%s\", %i, %i, %i, %i, %i, %i, %i, %f, %i, %i, %i, %f, %i, %i)",
tmpstr, spawn->GetLevel(), spawn->GetRace(), spawn->GetClass(), spawn->GetMaxHP(),
spawn->GetGender(), spawn->GetTexture(), spawn->GetHelmTexture(), spawn->GetSize(),
spawn->GetLoottableID(), spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
auto results = QueryDatabase(query);
|
How in the world is sec_melee_type getting set to an arbitrary negative int32? I checked and double-checked the number of fields and values being passed, made sure there are as many %s/%i/%f format specifiers as arguments being supplied to StringFormat, and I'm just scratching my head.
I tried it both without (above) and with (below) the #npcspawn create extra parameter of 1:
Quote:
[08-01-2015 :: 18:05:01] [MySQL Error] 1264: Out of range value for column 'sec_melee_type' at row 1
INSERT INTO npc_types (id, name, level, race, class, hp, gender, texture, helmtexture, size, loottable_id, merchant_id, face, runspeed, prim_melee_type, sec_melee_type) VALUES(54308, "WoodElf" , 25, 4, 0, 723, 1, 0, 0, 0.000000, 0, 0, 0, 0.000000, 28, -1508384059)
|
Anybody have an idea?
|