Fixed getboundkey1/getboundkey2 crashing when the key is null

This commit is contained in:
smallmodel committed 2023-08-14 01:56:43 +02:00
1 parent 99dc7bf7f2
commit 0898bffb43
1 file changed
+10 -2
+10 -2
View File
@@ -4160,7 +4160,11 @@ void ScriptThread::EventGetBoundKey1(Event *ev)
str sCommand = ev->GetString(1);
gi.Key_GetKeysForCommand(sCommand, &iKey1, &iKey2);
pszKeyName = gi.Key_KeynumToBindString(iKey1);
if (iKey1) {
pszKeyName = gi.Key_KeynumToBindString(iKey1);
} else {
pszKeyName = "";
}
ev->AddString(pszKeyName);
}
@@ -4173,7 +4177,11 @@ void ScriptThread::EventGetBoundKey2(Event *ev)
str sCommand = ev->GetString(1);
gi.Key_GetKeysForCommand(sCommand, &iKey1, &iKey2);
pszKeyName = gi.Key_KeynumToBindString(iKey2);
if (iKey2) {
pszKeyName = gi.Key_KeynumToBindString(iKey2);
} else {
pszKeyName = "";
}
ev->AddString(pszKeyName);
}