mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-20 08:00:23 +02:00
Fixed getboundkey1/getboundkey2 crashing when the key is null
This commit is contained in:
1 file changed
+10
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user