KnightOnline icon indicating copy to clipboard operation
KnightOnline copied to clipboard

Hello SetText Error null

Open KiraAmora61 opened this issue 6 years ago • 5 comments

image

Old

void CUIMessageBox::SetText(const std::string& szMsg) { m_pText_Message->SetString(szMsg); }

void CUIMessageBox::SetTitle(const std::string& szTitle) { m_pText_Title->SetString(szTitle); }

New now

void CUIMessageBox::SetText(const std::string& szMsg) { if (NULL == m_pText_Message) return;

m_pText_Message->SetString(szMsg);

}

void CUIMessageBox::SetTitle(const std::string& szTitle) { if (NULL == m_pText_Title) return;

m_pText_Title->SetString(szTitle);

}

Is it true? -now thanks <3

KiraAmora61 avatar Jun 04 '19 15:06 KiraAmora61

What is the question exactly ?,

onurcanbektas avatar Jun 04 '19 16:06 onurcanbektas

@onurcanbektas bang problem

KiraAmora61 avatar Jun 04 '19 17:06 KiraAmora61

You might look into why the control's not loaded here, because that seems like more of a problem than the fact it's crashing.

twostars avatar Jun 05 '19 05:06 twostars

@twostars yes Can I get a skype address

KiraAmora61 avatar Jun 05 '19 13:06 KiraAmora61

If m_pText_Message is nullptr it means the control's not loaded, which means either the UI needs updating or it's being used for a specialisation of a messagebox UI that isn't named the same.

You don't show a callstack here so I can't tell which instance is theoretically being used here, and I don't recall if there were changes in the naming for this UI, but it should be fairly straightforward to find out. Load up the relevant UI in the UI editor and check what it's called, or just set a breakpoint there & check the names of the loaded children.

Checking if it's set stops it from crashing, but a messagebox without a message kind've defeats the purpose of said messagebox, so you should really find out why the control isn't attached here.

twostars avatar Jun 06 '19 06:06 twostars