Skip to content

Commit

Permalink
Revert "Test for #9178 (unbindKey not working properly) by reverting …
Browse files Browse the repository at this point in the history
…part of de1236c (Fixed #5391: Secondary command binds don't function properly)"

This reverts commit 92a12e0.
  • Loading branch information
ccw808 committed Jun 23, 2018
1 parent 04c7c9e commit ac015db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Expand Up @@ -6420,12 +6420,11 @@ bool CStaticFunctionDefinitions::BindKey(const char* szKey, const char* szHitSta
if (bKey)
{
bool bHitState = true;
// Activate all keys for this command
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
// Check if its binded already (dont rebind)
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
{
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
return true;
}

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

bHitState = false;
pKeyBinds->SetAllCommandsActive(szResource, true, szCommandName, bHitState, szArguments, true);
if (pKeyBinds->CommandExists(szKey, szCommandName, true, bHitState, szArguments, szResource, true, true))
{
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, szArguments, szResource, true, true);
return true;
}

if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
pKeyBinds->AddCommand(szKey, szCommandName, szArguments, bHitState, szResource, true))
Expand Down Expand Up @@ -6516,12 +6513,14 @@ bool CStaticFunctionDefinitions::UnbindKey(const char* szKey, const char* szHitS
if ((!stricmp(szHitState, "down") || !stricmp(szHitState, "both")) &&
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
{
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
bSuccess = true;
}
bHitState = false;
if ((!stricmp(szHitState, "up") || !stricmp(szHitState, "both")) &&
pKeyBinds->SetCommandActive(szKey, szCommandName, bHitState, NULL, szResource, false, true))
{
pKeyBinds->SetAllCommandsActive(szResource, false, szCommandName, bHitState, NULL, true);
bSuccess = true;
}
}
Expand Down

0 comments on commit ac015db

Please sign in to comment.