Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit f5ab419

Browse files
committed
Fix code style ...
1 parent 7053095 commit f5ab419

File tree

2 files changed

+39
-27
lines changed

2 files changed

+39
-27
lines changed
7 Bytes
Binary file not shown.

addons/sourcemod/scripting/n_arms_fix.sp

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#define LEGACY_MODELS_PATH "models/player/custom_player/legacy/"
2020
#define MODELS_PATH "models/player/"
2121

22-
static int g_iFileChangeTime;
23-
static int g_iProtectedMapsTime;
22+
static int g_iConfigFileChange;
23+
static int g_iProtectedMapsFileChange;
2424

2525
ConVar g_cvAutoSpawnCvar;
2626

@@ -76,11 +76,11 @@ ArrayList g_aMapCTModels = null;
7676

7777
public Plugin myinfo =
7878
{
79-
name = "-N- Arms Fix",
80-
author = "NomisCZ (-N-)",
81-
description = "CS:GO models arms fix",
82-
version = PLUGIN_VERSION,
83-
url = "https://github.com/NomisCZ"
79+
name = "-N- Arms Fix",
80+
author = "NomisCZ (-N-)",
81+
description = "CS:GO models arms fix",
82+
version = PLUGIN_VERSION,
83+
url = "https://github.com/NomisCZ"
8484
};
8585

8686
public void OnPluginStart()
@@ -121,7 +121,7 @@ public void OnMapStart()
121121

122122
public void OnConfigsExecuted()
123123
{
124-
g_bAutoSpawn = g_cvAutoSpawnCvar.BoolValue;
124+
g_bAutoSpawn = g_cvAutoSpawnCvar.BoolValue;
125125
}
126126

127127
public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
@@ -222,9 +222,9 @@ public void LoadProtectedMaps()
222222

223223
int fileLastChangeTime = GetFileTime(g_sProtectedMapsFilePath, FileTime_LastChange);
224224

225-
if (fileLastChangeTime != g_iProtectedMapsTime) {
225+
if (fileLastChangeTime != g_iProtectedMapsFileChange) {
226226

227-
g_iProtectedMapsTime = fileLastChangeTime;
227+
g_iProtectedMapsFileChange = fileLastChangeTime;
228228
g_bProtectedMapsChanged = true;
229229

230230
} else {
@@ -243,7 +243,8 @@ public void GenerateConfigFiles()
243243
return;
244244
}
245245

246-
if ((GetFileTime("gamemodes_server.txt", FileTime_LastChange) == g_iFileChangeTime) && !g_bProtectedMapsChanged) {
246+
if ((GetFileTime("gamemodes_server.txt", FileTime_LastChange) == g_iConfigFileChange) && !g_bProtectedMapsChanged) {
247+
247248
PrintToServer("%s Nothing changed, config is ready.", PLUGIN_TAG);
248249
return;
249250
}
@@ -376,7 +377,7 @@ public void GenerateConfigFiles()
376377
delete kvServer;
377378
delete kvCustom;
378379

379-
g_iFileChangeTime = GetFileTime("gamemodes_server.txt", FileTime_LastChange);
380+
g_iConfigFileChange = GetFileTime("gamemodes_server.txt", FileTime_LastChange);
380381
}
381382

382383
public void GetMapConfig()
@@ -401,6 +402,7 @@ public void GetMapConfig()
401402
}
402403

403404
if (inError) {
405+
404406
_GetMapConfig_Done(false);
405407
return;
406408
}
@@ -660,8 +662,9 @@ public bool ExportKvToFile(KeyValues kv, const char[] file)
660662
{
661663
File fh = OpenFile(file, "wb");
662664

663-
if (fh == null)
664-
return false;
665+
if (fh == null) {
666+
return false;
667+
}
665668

666669
IterateKvKeys(kv, fh, 0);
667670

@@ -686,15 +689,21 @@ public void IterateKvKeys(KeyValues kv, File fh, int tab)
686689

687690
WriteKvLine(fh, tab, "{");
688691

689-
if (kv.GotoFirstSubKey(false)) {
690-
do {
691-
if (kv.GetDataType(NULL_STRING) == KvData_None)
692-
IterateKvKeys(kv, fh, tab + 1);
693-
else {
692+
if (kv.GotoFirstSubKey(false)) {
693+
694+
do {
695+
696+
if (kv.GetDataType(NULL_STRING) == KvData_None) {
697+
698+
IterateKvKeys(kv, fh, tab + 1);
699+
700+
} else {
701+
694702
kv.GetSectionName(buffer, sizeof(buffer));
695703
kv.GetString(NULL_STRING, buffer2, sizeof(buffer2));
696704
WriteKvLine(fh, tab + 1, "\"%s\" \"%s\"", buffer, buffer2);
697-
}
705+
}
706+
698707
} while (kv.GotoNextKey(false));
699708

700709
kv.GoBack();
@@ -712,20 +721,23 @@ public void IterateKvKeys(KeyValues kv, File fh, int tab)
712721
public void WriteKvLine(File fh, int tab, const char[] string, any ...)
713722
{
714723
char buffer[512];
724+
715725
VFormat(buffer, sizeof(buffer), string, 4);
716-
Format(buffer, sizeof(buffer), "%s\n", buffer);
717-
for (int i = 0; i < tab; i++)
726+
Format(buffer, sizeof(buffer), "%s\n", buffer);
727+
728+
for (int i = 0; i < tab; i++) {
718729
Format(buffer, sizeof(buffer), " %s", buffer);
730+
}
731+
719732
fh.WriteString(buffer, false);
720733
}
721734

722735
bool IsValidClient(int client, bool AllowDead = true, bool AllowBots = false)
723736
{
724-
if (!(1 <= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !AllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!AllowDead && !IsPlayerAlive(client)))
725-
{
726-
return false;
727-
}
728-
return true;
737+
if (!(1 <= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !AllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!AllowDead && !IsPlayerAlive(client))) {
738+
return false;
739+
}
740+
return true;
729741
}
730742

731743
public bool HasClientGloves(int client)

0 commit comments

Comments
 (0)