ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   EVENT_ANTIQUITY_SCRYING_RESULT causes game crash (https://www.esoui.com/forums/showthread.php?t=9990)

Masteroshi430 11/16/21 03:34 PM

EVENT_ANTIQUITY_SCRYING_RESULT causes game crash
 
Hi there, it looks like
Quote:

EVENT_MANAGER:RegisterForEvent("name", EVENT_ANTIQUITY_SCRYING_RESULT, myFunction)
causes the game to totally crash when starting Scrying

Am I alone in that case or is there something I do wrong?

EDIT: I removed GetDigSpotAntiquityId() in the function called just after and it doesn't crash anymore

Baertram 11/16/21 04:33 PM

Are you sure it was ONLY GetDigSpotAntiquityId() you have removed or did you after that call to the function do any further checks with the return value?
ZOs always checks this e.g.

Lua Code:
  1. local antiquityId = GetDigSpotAntiquityId()
  2. if antiquityId ~= 0 then

before it hands in the antiquityId to the antiquity data manager, e.g. to get the current dig data:

Lua Code:
  1. ANTIQUITY_DATA_MANAGER:GetAntiquityData(antiquityId)

Else check the original ZOs handler for that event, it does check the "RESULT" parameter of the evet before it uses GetDigSpotAntiquityId, or further more it does not use that function but another one called "GetScryingCurrentAntiquityId()"!


https://github.com/esoui/esoui/blob/...lers.lua#L1162
Lua Code:
  1. CENTER_SCREEN_EVENT_HANDLERS[EVENT_ANTIQUITY_SCRYING_RESULT] = function(result)
  2.     --The map handles the case where you improved and unlocked more goals than before
  3.     if result == ANTIQUITY_SCRYING_RESULT_NO_PROGRESS or result == ANTIQUITY_SCRYING_RESULT_NO_ADDITIONAL_PROGRESS then
  4.         local antiquityId = GetScryingCurrentAntiquityId()
  5.         local antiquityData = ANTIQUITY_DATA_MANAGER:GetAntiquityData(antiquityId)
  6.         if antiquityData then
  7.             local numGoalsAchieved = antiquityData:GetNumGoalsAchieved()
  8.             local messageParams = CENTER_SCREEN_ANNOUNCE:CreateMessageParams(CSA_CATEGORY_SCRYING_PROGRESS_TEXT)
  9.             messageParams:SetText(GetString("SI_ANTIQUITYSCRYINGRESULT", result))
  10.             messageParams:SetCSAType(CENTER_SCREEN_ANNOUNCE_TYPE_ANTIQUITY_SCRYING_RESULT)
  11.             messageParams:SetScryingProgressData(numGoalsAchieved, numGoalsAchieved, antiquityData:GetTotalNumGoals())
  12.             return messageParams
  13.         end
  14.     end
  15. end

ZOS_DanBatson 11/16/21 06:23 PM

This crash has been fixed internally. We never hit it because we never call that function unless we're actually in a dig game. For now, you should just do the same, avoid calling that function unless a dig game is currently ongoing (IsDiggingGameActive()).


All times are GMT -6. The time now is 06:21 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI