1
0
Bifurcation 0

Applied strlen fix for issue 427 suggested by jisonpoo in comment 10 (http://code.google.com/p/questhelperredux/issues/detail?id=427#c10)

Cette révision appartient à :
Nathanial.C.Jones 2011-06-14 12:29:34 +00:00
Parent 73a1606070
révision 3ee759e502
1 fichiers modifiés avec 3 ajouts et 3 suppressions

Voir le fichier

@ -2,20 +2,20 @@ QuestHelper_File["collect_util.lua"] = "4.0.1.$svnversion$"
QuestHelper_Loadtime["collect_util.lua"] = GetTime()
local function IsMonsterGUID(guid)
QuestHelper: Assert(#guid == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(strlen(guid) == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(guid:sub(1, 2) == "0x", "guid 0x-prefix " .. guid)
return guid:sub(5, 5) == "3" or guid:sub(5, 5) == "5"
end
local function GetMonsterUID(guid)
QuestHelper: Assert(#guid == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(strlen(guid) == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(guid:sub(1, 2) == "0x", "guid 0x-prefix " .. guid)
QuestHelper: Assert(guid:sub(5, 5) == "3" or guid:sub(5, 5) == "5", "guid 3-prefix " .. guid) -- It *shouldn't* be a player or a pet by the time we've gotten here. If so, something's gone wrong.
return guid:sub(9, 18) -- here's our actual identifier
end
local function GetMonsterType(guid)
QuestHelper: Assert(#guid == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(strlen(guid) == 18, "guid len " .. guid) -- 64 bits, plus the 0x prefix
QuestHelper: Assert(guid:sub(1, 2) == "0x", "guid 0x-prefix " .. guid)
QuestHelper: Assert(guid:sub(5, 5) == "3" or guid:sub(5, 5) == "5", "guid 3-prefix " .. guid) -- It *shouldn't* be a player or a pet by the time we've gotten here. If so, something's gone wrong.
if GetBuildInfo():sub(1, 3) == "3.2" then