Skip to content

Commit 8d15d07

Browse files
committed
Run scripts/fix_style.py
1 parent fb892fd commit 8d15d07

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

src/game/client/components/tclient/conditional.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void CConditional::ParseString(char *pBuf, int Length)
7070
HasBrackets = true;
7171
if(!HasBrackets)
7272
return;
73-
73+
7474
// May give malformed result on buffer overflow
7575

7676
int Len = strnlen(pBuf, Length);
@@ -86,15 +86,15 @@ void CConditional::ParseString(char *pBuf, int Length)
8686
continue;
8787
// Count number of backslashes before this character
8888
int BackslashCount = 0;
89-
for (int j = i - 1; j >= 0 && pBuf[j] == '\\'; --j)
89+
for(int j = i - 1; j >= 0 && pBuf[j] == '\\'; --j)
9090
BackslashCount++;
9191
if(BackslashCount % 2 != 0)
9292
continue;
93-
if (pBuf[i] == '{')
93+
if(pBuf[i] == '{')
9494
{
9595
LastOpen = i;
9696
}
97-
else if (pBuf[i] == '}' && LastOpen != -1)
97+
else if(pBuf[i] == '}' && LastOpen != -1)
9898
{
9999
ClosePos = i;
100100
break;
@@ -141,7 +141,7 @@ void CConditional::ParseString(char *pBuf, int Length)
141141
int CConditional::EscapeString(char *pIn, char *pBuf, int Length)
142142
{
143143
int WriteIndex = 0;
144-
for (int i = 0; pIn[i] != '\0'; ++i)
144+
for(int i = 0; pIn[i] != '\0'; ++i)
145145
{
146146
char c = pIn[i];
147147

@@ -166,12 +166,12 @@ int CConditional::EscapeString(char *pIn, char *pBuf, int Length)
166166
void CConditional::UnescapeString(char *pString, int Length)
167167
{
168168
int WritePos = 0; // Position to write the unescaped char
169-
for (int ReadPos = 0; ReadPos < Length - 1; ReadPos++)
169+
for(int ReadPos = 0; ReadPos < Length - 1; ReadPos++)
170170
{
171-
if (pString[ReadPos] == '\\' && ReadPos + 1 < Length)
171+
if(pString[ReadPos] == '\\' && ReadPos + 1 < Length)
172172
{
173173
char NextChar = pString[ReadPos + 1];
174-
if (NextChar == '\\' || NextChar == '{' || NextChar == '}')
174+
if(NextChar == '\\' || NextChar == '{' || NextChar == '}')
175175
{
176176
// Replace the escape sequence by the actual character
177177
pString[WritePos++] = NextChar;

src/game/client/components/tclient/mod.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,12 @@ void CMod::OnConsoleInit()
300300
This.Kill(CIden(This, pResult->GetString(i), CIden::EParseMode::NAME), true);
301301
});
302302

303-
Console()->Chain("+fire", [](IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) {
304-
pfnCallback(pResult, pCallbackUserData);
305-
((CMod *)pUserData)->OnFire(pResult->GetInteger(0));
306-
}, this);
303+
Console()->Chain(
304+
"+fire", [](IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) {
305+
pfnCallback(pResult, pCallbackUserData);
306+
((CMod *)pUserData)->OnFire(pResult->GetInteger(0));
307+
},
308+
this);
307309
}
308310

309311
void CMod::OnRender()
@@ -434,7 +436,8 @@ void CMod::ModWeapon(int Id)
434436
{
435437
public:
436438
const char *m_pBuf;
437-
CResultModFire(const char *pBuf) : IResult(0), m_pBuf(pBuf) {}
439+
CResultModFire(const char *pBuf) :
440+
IResult(0), m_pBuf(pBuf) {}
438441
int NumArguments() const
439442
{
440443
return 1;
@@ -448,7 +451,7 @@ void CMod::ModWeapon(int Id)
448451
int GetInteger(unsigned Index) const override { return 0; };
449452
float GetFloat(unsigned Index) const override { return 0.0f; };
450453
std::optional<ColorHSLA> GetColor(unsigned Index, float DarkestLighting) const override { return std::nullopt; };
451-
void RemoveArgument(unsigned Index) override {};
454+
void RemoveArgument(unsigned Index) override{};
452455
int GetVictim() const override { return -1; };
453456
};
454457

@@ -503,8 +506,7 @@ void CMod::OnFire(bool Pressed)
503506
const float AngleDelta = dot(normalize(Other.m_RenderPos - Pos), Angle);
504507
if(AngleDelta < 0.9f)
505508
continue;
506-
const float Score = (AngleDelta - 1.0f) * 10.0f * MaxRange
507-
+ (MaxRange - PosDelta);
509+
const float Score = (AngleDelta - 1.0f) * 10.0f * MaxRange + (MaxRange - PosDelta);
508510
if(Score > BestClientScore)
509511
{
510512
BestClientScore = Score;

0 commit comments

Comments
 (0)