diff --git a/addons/sourcemod/scripting/gokz-core/timer/timer.sp b/addons/sourcemod/scripting/gokz-core/timer/timer.sp index 0427258b..cea552de 100644 --- a/addons/sourcemod/scripting/gokz-core/timer/timer.sp +++ b/addons/sourcemod/scripting/gokz-core/timer/timer.sp @@ -60,7 +60,7 @@ bool TimerStart(int client, int course, bool allowMidair = false, bool playSound || !IsPlayerValidMoveType(client) || !allowMidair && (!Movement_GetOnGround(client) || JustLanded(client)) || allowMidair && !Movement_GetOnGround(client) && (!GOKZ_GetValidJump(client) || GOKZ_GetHitPerf(client)) - || (GOKZ_GetTimerRunning(client) && GOKZ_GetCourse(client) != course)) + || (GOKZ_GetTimerRunning(client) && GOKZ_GetCourse(client) != course && GetVirtualStartCourse(client) != course)) { return false; } diff --git a/addons/sourcemod/scripting/gokz-core/timer/virtual_buttons.sp b/addons/sourcemod/scripting/gokz-core/timer/virtual_buttons.sp index 8701f023..3855a150 100644 --- a/addons/sourcemod/scripting/gokz-core/timer/virtual_buttons.sp +++ b/addons/sourcemod/scripting/gokz-core/timer/virtual_buttons.sp @@ -37,6 +37,11 @@ bool GetHasVirtualEndButton(int client) return hasVirtualEndButton[client]; } +int GetVirtualStartCourse(int client) +{ + return virtualStartCourse[client]; +} + bool ToggleVirtualButtonsLock(int client) { virtualButtonsLocked[client] = !virtualButtonsLocked[client]; diff --git a/addons/sourcemod/scripting/gokz-localranks/db/sql.sp b/addons/sourcemod/scripting/gokz-localranks/db/sql.sp index e0b07776..f768e9ad 100644 --- a/addons/sourcemod/scripting/gokz-localranks/db/sql.sp +++ b/addons/sourcemod/scripting/gokz-localranks/db/sql.sp @@ -17,16 +17,16 @@ ALTER TABLE Maps \ char sqlite_maps_insertranked[] = "\ INSERT OR IGNORE INTO Maps \ (InRankedPool, Name) \ - VALUES %s"; + VALUES (%d, '%s')"; char sqlite_maps_updateranked[] = "\ UPDATE OR IGNORE Maps \ SET InRankedPool=%d \ - WHERE Name IN (%s)"; + WHERE Name = '%s'"; char mysql_maps_upsertranked[] = "\ INSERT INTO Maps (InRankedPool, Name) \ - VALUES %s \ + VALUES (%d, '%s') \ ON DUPLICATE KEY UPDATE \ InRankedPool=VALUES(InRankedPool)"; diff --git a/addons/sourcemod/scripting/gokz-localranks/db/update_ranked_map_pool.sp b/addons/sourcemod/scripting/gokz-localranks/db/update_ranked_map_pool.sp index 26f2b4ec..ee9bd6dd 100644 --- a/addons/sourcemod/scripting/gokz-localranks/db/update_ranked_map_pool.sp +++ b/addons/sourcemod/scripting/gokz-localranks/db/update_ranked_map_pool.sp @@ -7,95 +7,76 @@ void DB_UpdateRankedMapPool(int client) { - Handle file = OpenFile(LR_CFG_MAP_POOL, "r"); + File file = OpenFile(LR_CFG_MAP_POOL, "r"); if (file == null) { - LogError("Failed to load file: \"%s\".", LR_CFG_MAP_POOL); + LogError("Failed to load file: '%s'.", LR_CFG_MAP_POOL); if (IsValidClient(client)) { - // TODO Translation phrases? - GOKZ_PrintToChat(client, true, "{grey}There was a problem opening file '%s'.", LR_CFG_MAP_POOL); + GOKZ_PrintToChat(client, true, "%t", "Ranked Map Pool - Error"); } return; } - char map[33]; - ArrayList maps = new ArrayList(33, 0); + char map[256]; + int mapsCount = 0; + + Transaction txn = new Transaction(); + + // Reset all maps to be unranked + txn.AddQuery(sql_maps_reset_mappool); // Insert/Update maps in gokz-localranks-mappool.cfg to be ranked - while (ReadFileLine(file, map, sizeof(map))) + while (file.ReadLine(map, sizeof(map))) { TrimString(map); + String_ToLower(map, map, sizeof(map)); + + // Ignore blank lines and comments if (map[0] == '\0' || map[0] == ';' || (map[0] == '/' && map[1] == '/')) { continue; } - String_ToLower(map, map, sizeof(map)); - maps.PushString(map); - } - delete file; - if (maps.Length == 0) - { - if (client == 0) - { - PrintToServer("No maps found in file '%s'.", LR_CFG_MAP_POOL); - } - else + mapsCount++; + + switch (g_DBType) { - // TODO Translation phrases? - GOKZ_PrintToChat(client, true, "{darkred}No maps found in file '%s'.", LR_CFG_MAP_POOL); - GOKZ_PlayErrorSound(client); - } - return; - } + case DatabaseType_SQLite: + { + char updateQuery[512]; + gH_DB.Format(updateQuery, sizeof(updateQuery), sqlite_maps_updateranked, 1, map); - // Create VALUES e.g. (1,'kz_map1'),(1,'kz_map2') - int valuesSize = maps.Length * 40; - char[] values = new char[valuesSize]; - maps.GetString(0, map, sizeof(map)); - FormatEx(values, valuesSize, "(1,'%s')", map); - for (int i = 1; i < maps.Length; i++) - { - maps.GetString(i, map, sizeof(map)); - Format(values, valuesSize, "%s,(1,'%s')", values, map); - } + char insertQuery[512]; + gH_DB.Format(insertQuery, sizeof(insertQuery), sqlite_maps_insertranked, 1, map); - // Create query - int querySize = valuesSize + 128; - char[] query = new char[querySize]; + txn.AddQuery(updateQuery); + txn.AddQuery(insertQuery); + } + case DatabaseType_MySQL: + { + char query[512]; + gH_DB.Format(query, sizeof(query), mysql_maps_upsertranked, 1, map); - Transaction txn = SQL_CreateTransaction(); - // Reset all maps to be unranked - txn.AddQuery(sql_maps_reset_mappool); + txn.AddQuery(query); + } + } + } + + delete file; - switch (g_DBType) + if (mapsCount == 0) { - case DatabaseType_SQLite: - { - // Create list of maps e.g. 'kz_map1','kz_map2' - int mapListSize = maps.Length * 36; - char[] mapList = new char[mapListSize]; - maps.GetString(0, map, sizeof(map)); - FormatEx(mapList, mapListSize, "'%s'", map); - for (int i = 1; i < maps.Length; i++) - { - maps.GetString(i, map, sizeof(map)); - Format(mapList, mapListSize, "%s,'%s'", mapList, map); - } + LogError("No maps found in file: '%s'.", LR_CFG_MAP_POOL); - // UPDATE OR IGNORE - FormatEx(query, querySize, sqlite_maps_updateranked, 1, mapList); - txn.AddQuery(query); - // INSERT OR IGNORE - FormatEx(query, querySize, sqlite_maps_insertranked, values); - txn.AddQuery(query); - } - case DatabaseType_MySQL: + if (IsValidClient(client)) { - FormatEx(query, querySize, mysql_maps_upsertranked, values); - txn.AddQuery(query); + GOKZ_PrintToChat(client, true, "%t", "Ranked Map Pool - No Maps In File"); + GOKZ_PlayErrorSound(client); } + + delete txn; + return; } // Pass client user ID (or -1) as data @@ -105,9 +86,7 @@ void DB_UpdateRankedMapPool(int client) data = GetClientUserId(client); } - SQL_ExecuteTransaction(gH_DB, txn, DB_TxnSuccess_UpdateRankedMapPool, DB_TxnFailure_Generic, data, DBPrio_Low); - - delete maps; + gH_DB.Execute(txn, DB_TxnSuccess_UpdateRankedMapPool, DB_TxnFailure_Generic, data); } public void DB_TxnSuccess_UpdateRankedMapPool(Handle db, int userid, int numQueries, Handle[] results, any[] queryData) @@ -116,8 +95,7 @@ public void DB_TxnSuccess_UpdateRankedMapPool(Handle db, int userid, int numQuer if (IsValidClient(client)) { LogMessage("The ranked map pool was updated by %L.", client); - // TODO Translation phrases? - GOKZ_PrintToChat(client, true, "{grey}The ranked map pool was updated."); + GOKZ_PrintToChat(client, true, "%t", "Ranked Map Pool - Success"); } else { diff --git a/addons/sourcemod/scripting/gokz-mode-kztimer.sp b/addons/sourcemod/scripting/gokz-mode-kztimer.sp index 52c1a139..d7237b4b 100644 --- a/addons/sourcemod/scripting/gokz-mode-kztimer.sp +++ b/addons/sourcemod/scripting/gokz-mode-kztimer.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-kztimer.txt" -#define MODE_VERSION 214 +#define MODE_VERSION 215 #define DUCK_SPEED_NORMAL 8.0 #define PRE_VELMOD_MAX 1.104 // Calculated 276/250 #define PERF_SPEED_CAP 380.0 diff --git a/addons/sourcemod/scripting/gokz-mode-simplekz.sp b/addons/sourcemod/scripting/gokz-mode-simplekz.sp index a0439ab4..7d0f7738 100644 --- a/addons/sourcemod/scripting/gokz-mode-simplekz.sp +++ b/addons/sourcemod/scripting/gokz-mode-simplekz.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-simplekz.txt" -#define MODE_VERSION 18 +#define MODE_VERSION 19 #define PS_MAX_REWARD_TURN_RATE 0.703125 // Degrees per tick (90 degrees per second) #define PS_MAX_TURN_RATE_DECREMENT 0.015625 // Degrees per tick (2 degrees per second) #define PS_SPEED_MAX 26.54321 // Units diff --git a/addons/sourcemod/scripting/gokz-mode-vanilla.sp b/addons/sourcemod/scripting/gokz-mode-vanilla.sp index 5948c358..8e7e38df 100644 --- a/addons/sourcemod/scripting/gokz-mode-vanilla.sp +++ b/addons/sourcemod/scripting/gokz-mode-vanilla.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-vanilla.txt" -#define MODE_VERSION 14 +#define MODE_VERSION 15 float gF_ModeCVarValues[MODECVAR_COUNT] = { diff --git a/addons/sourcemod/scripting/gokz-quiet.sp b/addons/sourcemod/scripting/gokz-quiet.sp index c4c6a125..e5d7a971 100644 --- a/addons/sourcemod/scripting/gokz-quiet.sp +++ b/addons/sourcemod/scripting/gokz-quiet.sp @@ -15,12 +15,12 @@ -public Plugin myinfo = +public Plugin myinfo = { - name = "GOKZ Quiet", - author = "DanZay", - description = "Provides options for a quieter KZ experience", - version = GOKZ_VERSION, + name = "GOKZ Quiet", + author = "DanZay", + description = "Provides options for a quieter KZ experience", + version = GOKZ_VERSION, url = GOKZ_SOURCE_URL }; @@ -54,7 +54,7 @@ public void OnPluginStart() LoadTranslations("gokz-common.phrases"); LoadTranslations("gokz-quiet.phrases"); - + RegisterCommands(); for (int client = 1; client <= MaxClients; client++) @@ -72,13 +72,13 @@ public void OnAllPluginsLoaded() { Updater_AddPlugin(UPDATER_URL); } - + TopMenu topMenu; if (LibraryExists("gokz-core") && ((topMenu = GOKZ_GetOptionsTopMenu()) != null)) { GOKZ_OnOptionsMenuReady(topMenu); } - + for (int client = 1; client <= MaxClients; client++) { if (IsClientInGame(client)) @@ -111,7 +111,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float { return; } - + int soundscapeIndex = GetEntProp(client, Prop_Data, "soundscapeIndex"); if (GOKZ_GetOption(client, gC_QTOptionNames[QTOption_MapSounds]) == MapSounds_Disabled) { @@ -154,7 +154,7 @@ void OnJoinTeam_HidePlayers(int client, int team) { // Make sure client is only ever hooked once SDKUnhook(client, SDKHook_SetTransmit, OnSetTransmitClient); - + if (team == CS_TEAM_T || team == CS_TEAM_CT) { SDKHook(client, SDKHook_SetTransmit, OnSetTransmitClient); @@ -198,6 +198,11 @@ public Action Hook_WeaponSound(UserMsg msg_id, Protobuf msg, const int[] players return Plugin_Continue; } + // No one to send to so it doesn't matter if we block or not. We block just to end the function early. + if (newTotal == 0) + { + return Plugin_Handled; + } // Only way to modify the recipient list is to RequestFrame and create our own user message. char path[PLATFORM_MAX_PATH]; msg.ReadString("sound", path, sizeof(path)); @@ -233,7 +238,7 @@ public void RequestFrame_WeaponSound(DataPack dp) UserMsg msg_id = dp.ReadCell(); int newTotal = dp.ReadCell(); - int newClients[MAXPLAYERS]; + int newClients[MAXPLAYERS]; dp.ReadCellArray(newClients, newTotal); int flags = dp.ReadCell(); @@ -265,7 +270,7 @@ public Action Hook_NormalSound(int clients[MAXPLAYERS], int& numClients, char sa int ent = entity; while (ent > MAXPLAYERS) { - // Block some gun and knife sounds by trying to find its parent entity. + // Block some gun and knife sounds by trying to find its parent entity. ent = GetEntPropEnt(ent, Prop_Send, "moveparent"); if (ent < MAXPLAYERS) { @@ -288,8 +293,8 @@ public Action Hook_NormalSound(int clients[MAXPLAYERS], int& numClients, char sa numNewClients++; } } - - if (numNewClients != numClients) + + if (numNewClients != numClients) { numClients = numNewClients; return Plugin_Changed; @@ -402,7 +407,7 @@ public Action Hook_EffectDispatch(const char[] te_name, const int[] players, int int damageType = TE_ReadNum("m_nDamageType"); int entindex = TE_ReadNum("entindex"); int positionsAreRelativeToEntity = TE_ReadNum("m_bPositionsAreRelativeToEntity"); - + TE_Start("EffectDispatch"); TE_WriteNum("m_iEffectName", effIndex); TE_WriteFloatArray("m_vOrigin.x", origin, 3); @@ -413,7 +418,7 @@ public Action Hook_EffectDispatch(const char[] te_name, const int[] players, int TE_WriteNum("entindex", entindex); TE_WriteNum("m_bPositionsAreRelativeToEntity", positionsAreRelativeToEntity); TE_WriteNum("m_fFlags", flags); - + // Send the TE and stop the engine from processing its own. TE_Send(newClients, newTotal, delay); return Plugin_Stop; @@ -488,7 +493,7 @@ void RegisterOptions() { for (QTOption option; option < QTOPTION_COUNT; option++) { - GOKZ_RegisterOption(gC_QTOptionNames[option], gC_QTOptionDescriptions[option], + GOKZ_RegisterOption(gC_QTOptionNames[option], gC_QTOptionDescriptions[option], OptionType_Int, gI_QTOptionDefaultValues[option], 0, gI_QTOptionCounts[option] - 1); } } @@ -503,11 +508,11 @@ void OnOptionsMenuReady_OptionsMenu(TopMenu topMenu) { return; } - + gTM_Options = topMenu; gTMO_CatGeneral = gTM_Options.FindCategory(GENERAL_OPTION_CATEGORY); - - // Add gokz-quiet option items + + // Add gokz-quiet option items for (int option = 0; option < view_as(QTOPTION_COUNT); option++) { gTMO_ItemsQuiet[option] = gTM_Options.AddItem(gC_QTOptionNames[option], TopMenuHandler_QT, gTMO_CatGeneral); @@ -526,12 +531,12 @@ public void TopMenuHandler_QT(TopMenu topmenu, TopMenuAction action, TopMenuObje break; } } - + if (option == QTOPTION_INVALID) { return; } - + if (action == TopMenuAction_DisplayOption) { switch (option) @@ -557,14 +562,14 @@ void FormatToggleableOptionDisplay(int client, QTOption option, char[] buffer, i { if (GOKZ_GetOption(client, gC_QTOptionNames[option]) == MapSounds_Disabled) { - FormatEx(buffer, maxlength, "%T - %T", - gC_QTOptionPhrases[option], client, + FormatEx(buffer, maxlength, "%T - %T", + gC_QTOptionPhrases[option], client, "Options Menu - Disabled", client); } else { - FormatEx(buffer, maxlength, "%T - %T", - gC_QTOptionPhrases[option], client, + FormatEx(buffer, maxlength, "%T - %T", + gC_QTOptionPhrases[option], client, "Options Menu - Enabled", client); } } @@ -596,4 +601,4 @@ public Action CommandStopSound(int client, int args) { StopSounds(client); return Plugin_Handled; -} \ No newline at end of file +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/include/gokz.inc b/addons/sourcemod/scripting/include/gokz.inc index d2b9100e..dbd6d9c8 100644 --- a/addons/sourcemod/scripting/include/gokz.inc +++ b/addons/sourcemod/scripting/include/gokz.inc @@ -41,7 +41,7 @@ enum ObsMode #define PI 3.14159265359 #define SPEED_NORMAL 250.0 #define SPEED_NO_WEAPON 260.0 -#define IGNORE_JUMP_TIME 0.2 +#define IGNORE_JUMP_TIME 0.2 stock float PLAYER_MINS[3] = {-16.0, -16.0, 0.0}; stock float PLAYER_MAXS[3] = {16.0, 16.0, 72.0}; stock float PLAYER_MAXS_DUCKED[3] = {16.0, 16.0, 54.0}; @@ -60,9 +60,9 @@ stock float PLAYER_MAXS_DUCKED[3] = {16.0, 16.0, 54.0}; stock char[] GOKZ_FormatTime(float time, bool precise = true) { char formattedTime[12]; - + int roundedTime = RoundFloat(time * 100); // Time rounded to number of centiseconds - + int centiseconds = roundedTime % 100; roundedTime = (roundedTime - centiseconds) / 100; int seconds = roundedTime % 60; @@ -70,7 +70,7 @@ stock char[] GOKZ_FormatTime(float time, bool precise = true) int minutes = roundedTime % 60; roundedTime = (roundedTime - minutes) / 60; int hours = roundedTime; - + if (hours == 0) { if (precise) @@ -244,6 +244,10 @@ stock ObsMode GetObserverMode(int client) */ stock int GetObserverTarget(int client) { + if (!IsValidClient(client)) + { + return -1; + } ObsMode mode = GetObserverMode(client); if (mode == ObsMode_InEye || mode == ObsMode_Chase) { @@ -280,7 +284,7 @@ stock void EmitSoundToClientSpectators(int client, const char[] sound) stock float CalcDeltaAngle(float angleA, float angleB) { float difference = angleB - angleA; - + if (difference > 180.0) { difference = difference - 360.0; @@ -289,7 +293,7 @@ stock float CalcDeltaAngle(float angleA, float angleB) { difference = difference + 360.0; } - + return difference; } @@ -307,20 +311,20 @@ stock void Color_StripFromChatText(const char[] input, char[] output, int size) { int x = 0; for (int i = 0; input[i] != '\0'; i++) { - + if (x + 1 == size) { break; } - + int character = input[i]; - + if (character > 0x08) { output[x++] = character; } } - + output[x] = '\0'; } @@ -368,7 +372,7 @@ stock int NextIndex(int index, int max) } /** - * Reorders an array with current index at the front, and previous + * Reorders an array with current index at the front, and previous * values after, including looping back to the end after reaching * the start of the array. * @@ -407,14 +411,14 @@ stock int Steam2ToSteamAccountID(const char[] steamID2) { return -1; } - + int IDNumberPart1 = StringToInt(pieces[1]); int IDNumberPart2 = StringToInt(pieces[2]); if (pieces[1][0] != '0' && IDNumberPart1 == 0 || IDNumberPart1 != 0 && IDNumberPart1 != 1 || IDNumberPart2 <= 0) { return -1; } - + return IDNumberPart1 + (IDNumberPart2 << 1); } @@ -432,7 +436,7 @@ stock void TeleportPlayer(int client, const float origin[3], const float angles[ // Clear the player's parent before teleporting to fix being // teleported into seemingly random places if the player has a parent. AcceptEntityInput(client, "ClearParent"); - + Movement_SetOrigin(client, origin); if (setAngles) { @@ -441,20 +445,20 @@ stock void TeleportPlayer(int client, const float origin[3], const float angles[ Movement_SetEyeAngles(client, angles); } // Duck the player if there is something blocking them from above - Handle trace = TR_TraceHullFilterEx(origin, - origin, + Handle trace = TR_TraceHullFilterEx(origin, + origin, view_as( { -16.0, -16.0, 0.0 } ), // Standing players are 32 x 32 x 72 - view_as( { 16.0, 16.0, 72.0 } ), - MASK_PLAYERSOLID, - TraceEntityFilterPlayers, + view_as( { 16.0, 16.0, 72.0 } ), + MASK_PLAYERSOLID, + TraceEntityFilterPlayers, client); bool ducked = TR_DidHit(trace); - + if (holdStill) { // Prevent noclip exploit SetEntProp(client, Prop_Send, "m_CollisionGroup", GOKZ_COLLISION_GROUP_STANDARD); - + // Intelligently hold player still to prevent booster and trigger exploits StartHoldStill(client, ducked); } @@ -462,7 +466,7 @@ stock void TeleportPlayer(int client, const float origin[3], const float angles[ { ForcePlayerDuck(client); } - + delete trace; } @@ -472,7 +476,7 @@ static void StartHoldStill(int client, bool ducked) data.WriteCell(GetClientUserId(client)); data.WriteCell(0); // tick counter data.WriteCell(GOKZ_TP_FREEZE_TICKS); // number of ticks to hold still - data.WriteCell(ducked); + data.WriteCell(ducked); ContinueHoldStill(data); } @@ -484,12 +488,12 @@ public void ContinueHoldStill(DataPack data) int tickCount = data.ReadCell(); bool ducked = data.ReadCell(); delete data; - + if (!IsValidClient(client)) { return; } - + if (ticks < tickCount) { Movement_SetVelocity(client, view_as( { 0.0, 0.0, 0.0 } )); @@ -503,16 +507,16 @@ public void ContinueHoldStill(DataPack data) { Movement_SetMovetype(client, MOVETYPE_LADDER); } - + // Prevent noclip exploit SetEntProp(client, Prop_Send, "m_CollisionGroup", GOKZ_COLLISION_GROUP_STANDARD); - + // Force duck on player and make sure that the player can't trigger triggers above them. // they can still trigger triggers even when we force ducking. if (ducked) { ForcePlayerDuck(client); - + if (ticks < tickCount - 1) { // Don't trigger triggers @@ -524,7 +528,7 @@ public void ContinueHoldStill(DataPack data) SetEntProp(client, Prop_Send, "m_CollisionGroup", GOKZ_COLLISION_GROUP_STANDARD); } } - + ++ticks; data = new DataPack(); data.WriteCell(GetClientUserId(client)); @@ -556,11 +560,11 @@ stock void ForcePlayerDuck(int client) stock bool IsPlayerStuck(int client) { float vecMin[3], vecMax[3], vecOrigin[3]; - + GetClientMins(client, vecMin); GetClientMaxs(client, vecMax); GetClientAbsOrigin(client, vecOrigin); - + TR_TraceHullFilter(vecOrigin, vecOrigin, vecMin, vecMax, MASK_PLAYERSOLID, TraceEntityFilterPlayers); return TR_DidHit(); // head in wall ? } @@ -578,12 +582,12 @@ stock bool GetEntityAbsOrigin(int entity, float result[3]) { return false; } - + if (!HasEntProp(entity, Prop_Data, "m_vecAbsOrigin")) { return false; } - + GetEntPropVector(entity, Prop_Data, "m_vecAbsOrigin", result); return true; } @@ -631,7 +635,7 @@ stock int GOKZFindEntityByName(const char[] name, const char[] className = "", b { continue; } - + char entName[65]; GetEntityName(entity, entName, sizeof(entName)); if (StrEqual(entName, name)) @@ -719,10 +723,10 @@ stock void RotateVectorAxis(float vec[3], float axis[3], float theta, float resu { float cosTheta = Cosine(theta); float sinTheta = Sine(theta); - + float axisVecCross[3]; GetVectorCrossProduct(axis, vec, axisVecCross); - + for (int i = 0; i < 3; i++) { result[i] = (vec[i] * cosTheta) + (axisVecCross[i] * sinTheta) + (axis[i] * GetVectorDotProduct(axis, vec)) * (1.0 - cosTheta); @@ -750,7 +754,7 @@ stock void RotateVectorPitchYaw(float vec[3], float pitch, float yaw, float resu } /** - * Attempts to return a valid spawn location. + * Attempts to return a valid spawn location. * * @param origin Spawn origin if found. * @param angles Spawn angles if found. @@ -774,7 +778,7 @@ stock bool GetValidSpawn(float origin[3], float angles[3]) { spawnEntity = FindEntityByClassname(spawnEntity, "info_player_terrorist"); } - + if (spawnEntity != -1) { GetEntPropVector(spawnEntity, Prop_Data, "m_vecOrigin", spawnOrigin); @@ -799,7 +803,7 @@ stock bool GetValidSpawn(float origin[3], float angles[3]) } /** - * Check whether a position is a valid spawn location. + * Check whether a position is a valid spawn location. * A spawn location is considered valid if it is in bounds and not stuck inside the ground. * * @param origin Origin vector. @@ -842,9 +846,9 @@ stock void GetEntityPositions(int entity, float origin[3], float center[3], floa origin[i] += tempOrigin[i]; } } - + GetEntPropVector(ent, Prop_Data, "m_angRotation", angles); - + GetEntPropVector(ent, Prop_Send, "m_vecMaxs", maxs); GetEntPropVector(ent, Prop_Send, "m_vecMins", mins); for (int i = 0; i < 3; i++) @@ -895,7 +899,7 @@ static bool FindValidPositionAroundCenter(float center[3], float distFromCenter[ { float testOrigin[3]; int x, y; - + for (int i = 0; i < 3; i++) { // The search starts from the center then outwards to opposite directions. @@ -934,7 +938,7 @@ static bool CanSeeBox(float origin[3], float center[3], float distFromCenter[3]) float traceOrigin[3], traceDest[3], mins[3], maxs[3]; CopyVector(origin, traceOrigin); - + SubtractVectors(center, distFromCenter, mins); AddVectors(center, distFromCenter, maxs); @@ -978,7 +982,7 @@ stock int GOKZGetEntityFromAddress(Address pEntity) { return EntRefToEntIndex(LoadFromAddress(pEntity + view_as
(offs_RefEHandle), NumberType_Int32) | (1 << 31)); } - + // if we don't have it already, attempt to lookup offset based on SDK information // CWorld is derived from CBaseEntity so it should have both offsets int offs_angRotation = FindDataMapInfo(0, "m_angRotation"), offs_vecViewOffset = FindDataMapInfo(0, "m_vecViewOffset"); @@ -996,7 +1000,7 @@ stock int GOKZGetEntityFromAddress(Address pEntity) GetGameFolderName(game, sizeof(game)); SetFailState("Could not confirm offset of CBaseEntity::m_RefEHandle (incorrect assumption for game '%s'?)", game); } - + // offset seems right, cache it for the next call offs_RefEHandle = offs_angRotation + 0x0C; return GOKZGetEntityFromAddress(pEntity); diff --git a/addons/sourcemod/translations/gokz-localranks.phrases.txt b/addons/sourcemod/translations/gokz-localranks.phrases.txt index 3c2faf85..ea0d1ade 100644 --- a/addons/sourcemod/translations/gokz-localranks.phrases.txt +++ b/addons/sourcemod/translations/gokz-localranks.phrases.txt @@ -51,6 +51,18 @@ "chi" "{grey}本服务器没有设定可排名的地图." "ru" "{grey}На этом сервере нет ранжирования по картам." } + "Ranked Map Pool - Error" + { + "en" "{darkred}There was a problem updating the ranked map pool." + } + "Ranked Map Pool - Success" + { + "en" "{grey}The ranked map pool was updated." + } + "Ranked Map Pool - No Maps In File" + { + "en" "{darkred}No maps found in the ranked map pool file." + } "New Record (NUB)" { // Bill set a new NUB RECORD [Mode] @@ -457,7 +469,7 @@ // Global Top PRO "#format" "{1:s}" "en" "Global Top {1}" - "en" "全球排行 {1}" + "chi" "全球排行 {1}" "ru" "Глобальный топ {1}" } "Map Top Submenu - Title" diff --git a/addons/sourcemod/translations/gokz-paint.phrases.txt b/addons/sourcemod/translations/gokz-paint.phrases.txt index fb91d0a9..19611b61 100644 --- a/addons/sourcemod/translations/gokz-paint.phrases.txt +++ b/addons/sourcemod/translations/gokz-paint.phrases.txt @@ -22,7 +22,7 @@ "Paint Color Menu - Title" { "en" "Paint Color" - "en" "喷涂颜色" + "chi" "喷涂颜色" "ru" "Цвет краски" } diff --git a/addons/sourcemod/translations/gokz-racing.phrases.txt b/addons/sourcemod/translations/gokz-racing.phrases.txt index d1277d6b..756c5150 100644 --- a/addons/sourcemod/translations/gokz-racing.phrases.txt +++ b/addons/sourcemod/translations/gokz-racing.phrases.txt @@ -460,7 +460,7 @@ } "Checkpoint Limit Menu - Unlimited" { - "en" "Remove five" + "en" "Unlimited" "chi" "无限制" "ru" "Неограниченно" } @@ -470,7 +470,7 @@ // =====[ CP COOLDOWN MENU ]===== "Checkpoint Cooldown Menu - Title None" { - "en" "Remove five" + "en" "Cooldown between CPs: None" "chi" "移除所有" "ru" "Перезарядка ЧП: Нет" } @@ -483,13 +483,13 @@ } "Checkpoint Cooldown Menu - Add One Second" { - "en" "Add One Second" + "en" "Add 1s" "chi" "存点冷却 增加 1 秒" "ru" "Добавить 1с" } "Checkpoint Cooldown Menu - Add Five Seconds" { - "en" "Add Five Seconds" + "en" "Add 5s" "chi" "存点冷却 增加 5 秒" "ru" "Добавить 5с" } diff --git a/cfg/sourcemod/gokz/gokz-localranks-mappool.cfg b/cfg/sourcemod/gokz/gokz-localranks-mappool.cfg index 50f5c1ad..8a8032fe 100644 --- a/cfg/sourcemod/gokz/gokz-localranks-mappool.cfg +++ b/cfg/sourcemod/gokz/gokz-localranks-mappool.cfg @@ -1,4 +1,5 @@ // Map list read by the gokz-localranks !updatemappool command +// The maximum supported length for a single line is 255 characters // You can comment like this ; or you can comment like this