We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug This was tested with CoC 1.4.22. Player opens the PDA, clicks "Statistics", then closes PDA. Crashes to desktop.
To Reproduce Steps to reproduce the behavior:
Expected behavior Not crash
AV occurs here:
for (auto it = m_ChildWndList.begin(); m_ChildWndList.end() != it; ++it) { if (!(*it)->IsShown()) // <-- AV here continue; (*it)->Update(); }
I believe CUIRankingsCoC allowed this issue to be exposed considering CoP wouldn't use this. Its Update method does call into LUA:
CUIRankingsCoC
Update
void CUIRankingsCoC::Update() { //if (ParentHasMe()) // return; luabind::functor<bool> functorCanShow; if (GEnv.ScriptEngine->functor("pda.coc_rankings_can_show", functorCanShow)) { if (functorCanShow(m_index)) { if (!ParentHasMe()) { luabind::functor<pcstr> functorSetName; if (GEnv.ScriptEngine->functor("pda.coc_rankings_set_name", functorSetName)) SetName(functorSetName(m_index));
I'm not an expert in this codebase, but one possible fix could be changing:
void CUIPdaWnd::UpdateRankingWnd() { if (pUIRankingWnd) pUIRankingWnd->Update(); }
to
void CUIPdaWnd::UpdateRankingWnd() { if (m_pActiveDialog == pUIRankingWnd && pUIRankingWnd) pUIRankingWnd->Update(); }
It appears to fix the issue, and the rankings still display.
Another thing to note here is that this method:
void CUIRankingWnd::Update() { inherited::Update(); if (Device.dwTimeGlobal - m_previous_time > m_delay) { m_previous_time = Device.dwTimeGlobal; update_info(); } }
Used to not call inherited::Update();:
inherited::Update();
void CUIRankingWnd::Update() { if (Device.dwTimeGlobal - m_previous_time > m_delay) { m_previous_time = Device.dwTimeGlobal; update_info(); } }
This also fixes the issue. Anomaly xray also does the same, but I understand why it was added in OpenXRay to prevent the scrollbar from freezing.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
This was tested with CoC 1.4.22.
Player opens the PDA, clicks "Statistics", then closes PDA. Crashes to desktop.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not crash
AV occurs here:
I believe
CUIRankingsCoC
allowed this issue to be exposed considering CoP wouldn't use this. ItsUpdate
method does call into LUA:I'm not an expert in this codebase, but one possible fix could be changing:
to
It appears to fix the issue, and the rankings still display.
Another thing to note here is that this method:
Used to not call
inherited::Update();
:This also fixes the issue. Anomaly xray also does the same, but I understand why it was added in OpenXRay to prevent the scrollbar from freezing.
The text was updated successfully, but these errors were encountered: