Quantcast
EVENT_ANTIQUITY_SCRYING_RESULT causes game crash - ESOUI
Thread Tools Display Modes
11/16/21, 03:34 PM   #1
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 33
EVENT_ANTIQUITY_SCRYING_RESULT causes game crash

Hi there, it looks like
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

Last edited by Masteroshi430 : 11/16/21 at 03:47 PM.
  Reply With Quote
11/16/21, 04:33 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,821
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

Last edited by Baertram : 11/16/21 at 04:36 PM.
  Reply With Quote
11/16/21, 06:23 PM   #3
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 99
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()).
  Reply With Quote

ESOUI » Developer Discussions » Bug Reports » EVENT_ANTIQUITY_SCRYING_RESULT causes game crash

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off