Skip to content

Commit ac015db

Browse files
committed
Revert "Test for #9178 (unbindKey not working properly) by reverting part of de1236c (Fixed #5391: Secondary command binds don't function properly)"
This reverts commit 92a12e0.
1 parent 04c7c9e commit ac015db

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6420,12 +6420,11 @@ bool CStaticFunctionDefinitions::BindKey(const char* szKey, const char* szHitSta
64206420
if (bKey)
64216421
{
64226422
bool bHitState = true;
6423+
// Activate all keys for this command
6424+
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
64236425
// Check if its binded already (dont rebind)
64246426
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
6425-
{
6426-
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
64276427
return true;
6428-
}
64296428

64306429
if ((!stricmp(szHitState, "down") || !stricmp(szHitState, "both")) &&
64316430
pKeyBinds->AddCommand(szKey, szCommandName, szArguments, bHitState, szResource, true))
@@ -6435,11 +6434,9 @@ bool CStaticFunctionDefinitions::BindKey(const char* szKey, const char* szHitSta
64356434
}
64366435

64376436
bHitState = false;
6437+
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
64386438
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
6439-
{
6440-
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
64416439
return true;
6442-
}
64436440

64446441
if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
64456442
pKeyBinds->AddCommand(szKey, szCommandName, szArguments, bHitState, szResource, true))
@@ -6516,12 +6513,14 @@ bool CStaticFunctionDefinitions::UnbindKey(const char* szKey, const char* szHitS
65166513
if ((!stricmp(szHitState, "down") || !stricmp(szHitState, "both")) &&
65176514
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
65186515
{
6516+
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
65196517
bSuccess = true;
65206518
}
65216519
bHitState = false;
65226520
if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
65236521
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
65246522
{
6523+
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
65256524
bSuccess = true;
65266525
}
65276526
}

0 commit comments

Comments
 (0)