Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CS:GO Clantag set/get to use netprops + offset over sig + offset. #922

Merged
merged 4 commits into from
Nov 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions extensions/cstrike/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,11 @@ static inline cell_t GetPlayerStringVar(IPluginContext *pContext, const cell_t *
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
}

char **pVar = GetPlayerVarAddressOrError<char *>(varName, pContext, pPlayer);
char *pVar = GetPlayerVarAddressOrError<char>(varName, pContext, pPlayer);
if (pVar)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style would be !pVar here but this is okay too.

{
size_t len;
pContext->StringToLocalUTF8(params[2], params[3], *pVar, &len);
pContext->StringToLocalUTF8(params[2], params[3], pVar, &len);
return len;
}

Expand All @@ -800,13 +800,13 @@ static inline cell_t SetPlayerStringVar(IPluginContext *pContext, const cell_t *
return pContext->ThrowNativeError("Failed to locate %s offset in gamedata", szSizeName);
}

char **pVar = GetPlayerVarAddressOrError<char *>(varName, pContext, pPlayer);
char *pVar = GetPlayerVarAddressOrError<char>(varName, pContext, pPlayer);

if (pVar)
{
char *newValue;
pContext->LocalToString(params[2], &newValue);
Q_strncpy(*pVar, newValue, maxlen);
Q_strncpy(pVar, newValue, maxlen);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ke::SafeStrcpy ?

}

return 1;
Expand Down