Skip to content

Commit 92a12e0

Browse files
committed
Test for #9178 (unbindKey not working properly) by reverting part of de1236c (Fixed #5391: Secondary command binds don't function properly)
1 parent c6294eb commit 92a12e0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6389,11 +6389,12 @@ bool CStaticFunctionDefinitions::BindKey(const char* szKey, const char* szHitSta
63896389
if (bKey)
63906390
{
63916391
bool bHitState = true;
6392-
// Activate all keys for this command
6393-
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
63946392
// Check if its binded already (dont rebind)
63956393
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
6394+
{
6395+
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
63966396
return true;
6397+
}
63976398

63986399
if ((!stricmp(szHitState, "down") || !stricmp(szHitState, "both")) &&
63996400
pKeyBinds->AddCommand(szKey, szCommandName, szArguments, bHitState, szResource, true))
@@ -6403,9 +6404,11 @@ bool CStaticFunctionDefinitions::BindKey(const char* szKey, const char* szHitSta
64036404
}
64046405

64056406
bHitState = false;
6406-
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
64076407
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
6408+
{
6409+
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
64086410
return true;
6411+
}
64096412

64106413
if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
64116414
pKeyBinds->AddCommand(szKey, szCommandName, szArguments, bHitState, szResource, true))
@@ -6482,14 +6485,12 @@ bool CStaticFunctionDefinitions::UnbindKey(const char* szKey, const char* szHitS
64826485
if ((!stricmp(szHitState, "down") || !stricmp(szHitState, "both")) &&
64836486
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
64846487
{
6485-
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
64866488
bSuccess = true;
64876489
}
64886490
bHitState = false;
64896491
if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
64906492
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
64916493
{
6492-
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
64936494
bSuccess = true;
64946495
}
64956496
}

0 commit comments

Comments
 (0)