Fix compatibility whit rg_hint_message (#583)

When used reapi native rg_hint_message not work because tries to access to one pointer who not longer exists in CHintMessage::Send
This commit is contained in:
Franco Romaniello 2020-12-02 19:32:11 +01:00 committed by GitHub
parent 8d6bf017f5
commit c56982af18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@
CHintMessage::CHintMessage(const char *hintString, bool isHint, CUtlVector<const char *> *args, float duration)
{
m_hintString = hintString;
m_hintString = CloneString(hintString);
m_duration = duration;
m_isHint = isHint;
@ -16,6 +16,12 @@ CHintMessage::CHintMessage(const char *hintString, bool isHint, CUtlVector<const
CHintMessage::~CHintMessage()
{
m_args.PurgeAndDeleteArrays();
if (m_hintString)
{
delete[] m_hintString;
m_hintString = NULL;
}
}
void CHintMessage::Send(CBaseEntity *client)

View File

@ -65,7 +65,7 @@ public:
void Send(CBaseEntity *client);
private:
const char *m_hintString;
char *m_hintString;
bool m_isHint;
CUtlVector<char *> m_args;
float m_duration;