1
0
Bifurcation 0

MORE assertions. ;-P. Assertions are helpful when the messages are good. GO ASSERTIONS!

Cette révision appartient à :
Nathanial.C.Jones 2011-02-05 00:40:15 +00:00
Parent 80d06c012a
révision 6640999728
2 fichiers modifiés avec 9 ajouts et 0 suppressions

Voir le fichier

@ -7,6 +7,10 @@ local Minimap = _G.Minimap
-- These conversions are nasty, and this entire section needs a serious cleanup.
local function convertLocation(p)
QuestHelper: Assert(p, "Wait. What? This is checked before calling this function.")
QuestHelper: Assert(p.c, "p.c is nil")
QuestHelper: Assert(p.x, "p.x is nil")
QuestHelper: Assert(p.y, "p.y is nil")
return QuestHelper.Astrolabe:FromAbsoluteContinentPosition(p.c, p.x, p.y)
end
@ -486,6 +490,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
QuestHelper: Assert(objective, "Missing objective.")
QuestHelper: Assert(objective.loc, "Missing Location.")
local locarray = convertLocation(objective.loc)
QuestHelper: Assert(locarray, "Hmm, we aren't getting anything from the function... Why?")
QuestHelper: Assert(locarray[1] and locarray[2] and locarray[3] and locarray[4], "Location conversion failed. " .. tostring(locarray[1]) .. " " .. tostring(locarray[2]) .. " " .. tostring(locarray[3]) .. " " .. tostring(locarray[4]))
QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, convertLocation(objective.loc))
--QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, 0, 0, globx, globy)
@ -1053,6 +1058,7 @@ function QuestHelper:CreateMipmapDodad()
QuestHelper: Assert(self.obj, "Missing objective.")
QuestHelper: Assert(self.obj.loc, "Missing Location.")
local locarray = convertLocation(self.obj.loc)
QuestHelper: Assert(locarray, "Hmm, we aren't getting anything from the function... Why?")
QuestHelper: Assert(locarray[1] and locarray[2] and locarray[3] and locarray[4], "Location conversion failed. " .. tostring(locarray[1]) .. " " .. tostring(locarray[2]) .. " " .. tostring(locarray[3]) .. " " .. tostring(locarray[4]))
if not QuestHelper_Pref.hide and QuestHelper.Astrolabe:PlaceIconOnMinimap(self, convertLocation(self.obj.loc)) ~= -1 then

Voir le fichier

@ -366,6 +366,9 @@ function Astrolabe:GetAbsoluteContinentPosition( C, Z, xPos, yPos )
end
function Astrolabe:FromAbsoluteContinentPosition(C, xPos, yPos)
QuestHelper: Assert(C and xPos and YPos, "One of the arguments is nil. " .. tostring(C) .. " " .. tostring(xPos) .. " " .. tostring(yPos))
QuestHelper: Assert(WorldMapSize[C], string.format("WorldMapSize[%d] is nil.", C))
QuestHelper: Assert(WorldMapSize[C].width and WorldMapSize[C].height, string.format("WorldMapSize[%d] is missing one or more of its dimensions.", C))
return C, 0, xPos / WorldMapSize[C].width, yPos / WorldMapSize[C].height
end