Skip to content

Commit c506031

Browse files
committed
fix: No upgrades being available in CoC technician dialog
1 parent 756cbb9 commit c506031

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/xrGame/ui/UITalkDialogWnd.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,11 @@ void CUITalkDialogWnd::InitTalkDialogWnd()
147147
}
148148
}
149149

150-
void CUITalkDialogWnd::Show()
150+
void CUITalkDialogWnd::Show(const bool notify_scripts /*= true*/)
151151
{
152152
InventoryUtilities::SendInfoToActor("ui_talk_show");
153-
InventoryUtilities::SendInfoToLuaScripts("ui_talk_show");
153+
if (notify_scripts)
154+
InventoryUtilities::SendInfoToLuaScripts("ui_talk_show");
154155
inherited::Show(true);
155156
inherited::Enable(true);
156157

@@ -159,12 +160,13 @@ void CUITalkDialogWnd::Show()
159160
UI().Focus().LockToWindow(UIQuestionsList);
160161
}
161162

162-
void CUITalkDialogWnd::Hide()
163+
void CUITalkDialogWnd::Hide(const bool notify_scripts /*= true*/)
163164
{
164165
if (UI().Focus().GetLocker() == UIQuestionsList)
165166
UI().Focus().Unlock();
166167
InventoryUtilities::SendInfoToActor("ui_talk_hide");
167-
InventoryUtilities::SendInfoToLuaScripts("ui_talk_hide");
168+
if (notify_scripts)
169+
InventoryUtilities::SendInfoToLuaScripts("ui_talk_hide");
168170
inherited::Show(false);
169171
inherited::Enable(false);
170172
g_btnHint->Discard();

src/xrGame/ui/UITalkDialogWnd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class CUITalkDialogWnd final : public CUIWindow, public CUIWndCallback
2626

2727
virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData = NULL);
2828

29-
virtual void Show();
30-
virtual void Hide();
29+
virtual void Show(bool notify_scripts = true);
30+
virtual void Hide(bool notify_scripts = true);
3131
CUITalkWnd* m_pParent;
3232
u32 GetHeaderColor() { return m_iNameTextColor; }
3333
CGameFont* GetHeaderFont() { return m_pNameTextFont; }

src/xrGame/ui/UITalkWnd.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ void CUITalkWnd::SwitchToUpgrade()
339339
CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(CurrentGameUI());
340340
if (pGameSP)
341341
{
342-
UITalkDialogWnd->Hide();
342+
// Don't notify scripts that we are hiding the dialog because the CoC inventory_upgrade script will mess up otherwise.
343+
// See: https://github.com/OpenXRay/xray-16/issues/1852
344+
UITalkDialogWnd->Hide(false);
343345
StopSnd();
344346

345347
pGameSP->StartUpgrade(m_pOurInvOwner, m_pOthersInvOwner);

0 commit comments

Comments
 (0)