Irrespective of what the routine's syntax is I get an error when the loading screen closes and the player Reticle is over a Fishing Hole. I have it such that if the players Reticle is over something and GetString(SI_GAMECAMERAACTIONTYPE16) which is fishing, then preform an action.
Code:
if not Harvest.nodes.data[zone] then
return false
end
The problem is that the check occurs before the above Harvest.nodes.data[zone] is available. So I can't check it for nil either because the loading screen just went away and for a brief moment the information is not available.
Code:
if Harvest.nodes.data[zone] == nil then
return
end
This will fail.
Code:
if Harvest.nodes.data == nil then
return
end
This will fail.
Code:
if Harvest.nodes == nil then
return
end
This does not fail so the routine is not used and the error does not occur.
Question is how can I resolve this better? Is there a way to check, if the loading screen is open, and the game is busy, don't do anything?