Skip to content

Commit

Permalink
remove some sourcemod 1.11 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Jan 1, 2022
1 parent 3348e54 commit ae01454
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public int Native_ResetPerfectJumps(Handle handler, int numParams)

gI_Jumps[client] = 0;
gI_PerfectJumps[client] = 0;

return 0;
}

public void Bhopstats_PostThinkPost(int client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ public SMCResult OnStyleKeyValue(SMCParser smc, const char[] key, const char[] v
{
SetStyleSetting(gI_CurrentParserIndex, key, value);
gSM_StyleKeysSet.SetValue(key, true);
return SMCParse_Continue;
}

public int SortAscending_StyleOrder(int index1, int index2, const int[] array, any hndl)
Expand Down
4 changes: 4 additions & 0 deletions addons/sourcemod/scripting/shavit-chat.sp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,8 @@ public int MenuHandler_ChatRanks_First(Menu menu, MenuAction action, int param1,
{
delete menu;
}

return 0;
}

Action ShowChatRanksMenu(int client, int item)
Expand Down Expand Up @@ -998,6 +1000,8 @@ public int MenuHandler_ChatRanks(Menu menu, MenuAction action, int param1, int p
{
delete menu;
}

return 0;
}

void PreviewChat(int client, int rank)
Expand Down
23 changes: 20 additions & 3 deletions addons/sourcemod/scripting/shavit-core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ public any Native_UpdateLaggedMovement(Handle handler, int numParams)
int client = GetNativeCell(1);
bool user_timescale = GetNativeCell(2) != 0;
UpdateLaggedMovement(client, user_timescale);
return 1;
}

void UpdateLaggedMovement(int client, bool user_timescale)
Expand Down Expand Up @@ -1624,6 +1625,7 @@ public int Native_IsKZMap(Handle handler, int numParams)
public int Native_StartTimer(Handle handler, int numParams)
{
StartTimer(GetNativeCell(1), GetNativeCell(2));
return 0;
}

public int Native_StopTimer(Handle handler, int numParams)
Expand Down Expand Up @@ -1776,7 +1778,7 @@ public int Native_FinishMap(Handle handler, int numParams)

if (!gA_Timers[client].iFullTicks)
{
return;
return 0;
}

if(gCV_UseOffsets.BoolValue)
Expand All @@ -1798,7 +1800,7 @@ public int Native_FinishMap(Handle handler, int numParams)
if (gA_Timers[client].fCurrentTime <= 0.11)
{
StopTimer(client);
return;
return 0;
}

timer_snapshot_t snapshot;
Expand All @@ -1812,7 +1814,7 @@ public int Native_FinishMap(Handle handler, int numParams)

if(result != Plugin_Continue && result != Plugin_Changed)
{
return;
return 0;
}

#if DEBUG
Expand All @@ -1837,6 +1839,7 @@ public int Native_FinishMap(Handle handler, int numParams)
Call_Finish();

StopTimer(client);
return 1;
}

public int Native_PauseTimer(Handle handler, int numParams)
Expand All @@ -1848,6 +1851,7 @@ public int Native_PauseTimer(Handle handler, int numParams)
GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", gF_PauseVelocity[client]);

PauseTimer(client);
return 1;
}

public any Native_GetZoneOffset(Handle handler, int numParams)
Expand Down Expand Up @@ -1886,11 +1890,14 @@ public int Native_ResumeTimer(Handle handler, int numParams)
{
TeleportEntity(client, gF_PauseOrigin[client], gF_PauseAngles[client], gF_PauseVelocity[client]);
}

return 1;
}

public int Native_StopChatSound(Handle handler, int numParams)
{
gB_StopChatSound = true;
return 1;
}

public int Native_PrintToChatAll(Handle plugin, int numParams)
Expand All @@ -1908,6 +1915,7 @@ public int Native_PrintToChatAll(Handle plugin, int numParams)
}

gB_StopChatSound = false;
return 1;
}

public int Native_PrintToChat(Handle handler, int numParams)
Expand Down Expand Up @@ -1987,6 +1995,8 @@ public int Native_GotoEnd(Handle handler, int numParams)
Call_PushCell(client);
Call_PushCell(track);
Call_Finish();

return 1;
}

public int Native_RestartTimer(Handle handler, int numParams)
Expand Down Expand Up @@ -2096,6 +2106,8 @@ public int Native_SetPracticeMode(Handle handler, int numParams)
}

gA_Timers[client].bPracticeMode = practice;

return 1;
}

public int Native_IsPaused(Handle handler, int numParams)
Expand Down Expand Up @@ -2180,6 +2192,7 @@ public int Native_LogMessage(Handle plugin, int numParams)
FormatNativeString(0, 1, 2, 300, iWritten, sBuffer);

LogToFileEx(gS_LogPath, "[%s] %s", sPlugin, sBuffer);
return 1;
}

public int Native_MarkKZMap(Handle handler, int numParams)
Expand Down Expand Up @@ -2211,6 +2224,8 @@ public int Native_SetClientTimescale(Handle handler, int numParams)
CallOnTimescaleChanged(client, gA_Timers[client].fTimescale, timescale);
UpdateLaggedMovement(client, true);
}

return 1;
}

public any Native_GetAvgVelocity(Handle plugin, int numParams)
Expand All @@ -2226,11 +2241,13 @@ public any Native_GetMaxVelocity(Handle plugin, int numParams)
public any Native_SetAvgVelocity(Handle plugin, int numParams)
{
gA_Timers[GetNativeCell(1)].fAvgVelocity = GetNativeCell(2);
return 1;
}

public any Native_SetMaxVelocity(Handle plugin, int numParams)
{
gA_Timers[GetNativeCell(1)].fMaxVelocity = GetNativeCell(2);
return 1;
}

public any Native_Core_CookiesRetrieved(Handle plugin, int numParams)
Expand Down
2 changes: 2 additions & 0 deletions addons/sourcemod/scripting/shavit-hud.sp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ public Action Timer_QueryWindowsCvar(Handle timer, any data)
{
QueryClientConVar(client, "windows_speaker_config", OnWindowsCvarQueried);
}

return Plugin_Stop;
}

public void OnWindowsCvarQueried(QueryCookie cookie, int client, ConVarQueryResult result, const char[] cvarName, const char[] cvarValue, any value)
Expand Down
7 changes: 7 additions & 0 deletions addons/sourcemod/scripting/shavit-mapchooser.sp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ public Action Timer_OnMapTimeLeftChanged(Handle Timer)
{
CheckTimeLeft();
}

return Plugin_Continue;
}

public void Shavit_OnCountdownStart()
Expand Down Expand Up @@ -1320,6 +1322,7 @@ public Action Timer_ChangeMap(Handle timer, DataPack data)
data.ReadString(reason, sizeof(reason));

ForceChangeLevel(map, reason);
return Plugin_Stop;
}

/* Commands */
Expand Down Expand Up @@ -1734,6 +1737,8 @@ public int EnhancedMenuHandler(Menu menu, MenuAction action, int client, int par
{
OpenEnhancedMenu(client);
}

return 0;
}

void Nominate(int client, const char mapname[PLATFORM_MAX_PATH])
Expand Down Expand Up @@ -1942,6 +1947,8 @@ public int Null_Callback(Menu menu, MenuAction action, int param1, int param2)
{
delete menu;
}

return 0;
}

public void FindUnzonedMapCallback(Database db, DBResultSet results, const char[] error, any data)
Expand Down
1 change: 1 addition & 0 deletions addons/sourcemod/scripting/shavit-rankings.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ public int Native_Rankings_DeleteMap(Handle handler, int numParams)
char sQuery[512];
FormatEx(sQuery, sizeof(sQuery), "DELETE FROM %smaptiers WHERE map = '%s';", gS_MySQLPrefix, sMap);
gH_SQL.Query2(SQL_DeleteMap_Callback, sQuery, StrEqual(gS_Map, sMap, false), DBPrio_High);
return 1;
}

public int Native_GuessPointsForTime(Handle plugin, int numParams)
Expand Down
3 changes: 3 additions & 0 deletions addons/sourcemod/scripting/shavit-replay-playback.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,8 @@ public int Native_Replay_DeleteMap(Handle handler, int numParams)
{
OnMapStart();
}

return 1;
}

public int Native_GetClosestReplayTime(Handle plugin, int numParams)
Expand Down Expand Up @@ -1354,6 +1356,7 @@ public int Native_GetClosestReplayStyle(Handle plugin, int numParams)
public int Native_SetClosestReplayStyle(Handle plugin, int numParams)
{
gI_TimeDifferenceStyle[GetNativeCell(1)] = GetNativeCell(2);
return 1;
}

public int Native_GetLoopingBotByName(Handle plugin, int numParams)
Expand Down
3 changes: 3 additions & 0 deletions addons/sourcemod/scripting/shavit-replay-recorder.sp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ public int Native_SetPlayerPreFrames(Handle handler, int numParams)
int preframes = GetNativeCell(2);

gI_PlayerPrerunFrames[client] = preframes;
return 1;
}

public int Native_GetReplayData(Handle plugin, int numParams)
Expand Down Expand Up @@ -618,6 +619,7 @@ public int Native_SetReplayData(Handle handler, int numParams)
delete gA_PlayerFrames[client];
gA_PlayerFrames[client] = data;
gI_PlayerFrames[client] = data.Length;
return 1;
}

public int Native_HijackAngles(Handle handler, int numParams)
Expand Down Expand Up @@ -646,4 +648,5 @@ public int Native_HijackAngles(Handle handler, int numParams)
}

gB_HijackFramesKeepOnStart[client] = (numParams < 5) ? false : view_as<bool>(GetNativeCell(5));
return ticks;
}
7 changes: 7 additions & 0 deletions addons/sourcemod/scripting/shavit-wr.sp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ public Action Timer_Dominating(Handle timer)
SetEntProp(i, Prop_Send, "m_bPlayerDominatingMe", bHasWR[x], 1, x);
}
}

return Plugin_Continue;
}

void ResetWRs()
Expand Down Expand Up @@ -647,11 +649,13 @@ public int Native_GetWorldRecord(Handle handler, int numParams)
public int Native_ReloadLeaderboards(Handle handler, int numParams)
{
UpdateWRCache();
return 1;
}

public int Native_GetWRRecordID(Handle handler, int numParams)
{
SetNativeCellRef(2, gI_WRRecordID[GetNativeCell(1)][GetNativeCell(3)]);
return -1;
}

public int Native_GetWRName(Handle handler, int numParams)
Expand Down Expand Up @@ -688,11 +692,13 @@ public int Native_SetClientPB(Handle handler, int numParams)
float time = GetNativeCell(4);

gF_PlayerRecord[client][style][track] = time;
return 1;
}

public int Native_GetPlayerPB(Handle handler, int numParams)
{
SetNativeCellRef(3, gF_PlayerRecord[GetNativeCell(1)][GetNativeCell(2)][GetNativeCell(4)]);
return -1;
}

public int Native_GetClientCompletions(Handle handler, int numParams)
Expand Down Expand Up @@ -861,6 +867,7 @@ public int Native_DeleteWR(Handle handle, int numParams)
bool update_cache = view_as<bool>(GetNativeCell(7));

DeleteWR(style, track, map, steamid, recordid, delete_sql, update_cache);
return 1;
}

public int Native_GetStageWR(Handle plugin, int numParams)
Expand Down
6 changes: 5 additions & 1 deletion addons/sourcemod/scripting/shavit-zones.sp
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,13 @@ public int Native_IsClientCreatingZone(Handle handler, int numParams)
public int Native_SetStart(Handle handler, int numParams)
{
SetStart(GetNativeCell(1), GetNativeCell(2), view_as<bool>(GetNativeCell(3)));
return 1;
}

public int Native_DeleteSetStart(Handle handler, int numParams)
{
DeleteSetStart(GetNativeCell(1), GetNativeCell(2));
return 1;
}

public int Native_GetClientLastStage(Handle plugin, int numParams)
Expand Down Expand Up @@ -2483,7 +2485,7 @@ public int MenuHandler_DeleteAllZones(Menu menu, MenuAction action, int param1,

if(iInfo == -1)
{
return;
return 0;
}

Shavit_LogMessage("%L - deleted all zones from map `%s`.", param1, gS_Map);
Expand All @@ -2498,6 +2500,8 @@ public int MenuHandler_DeleteAllZones(Menu menu, MenuAction action, int param1,
{
delete menu;
}

return 0;
}

public void SQL_DeleteAllZones_Callback(Database db, DBResultSet results, const char[] error, any data)
Expand Down

0 comments on commit ae01454

Please sign in to comment.