Skip to content

Commit 3084e8d

Browse files
committed
add check win conditions forward
1 parent a0de7fe commit 3084e8d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

api_rounds.sma

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ new g_iFwRoundEnd;
2222
new g_iFwRoundExpired;
2323
new g_iFwRoundRestart;
2424
new g_iFwRoundTimerTick;
25+
new g_iFwCheckWinConditions;
2526

2627
new Array:g_irgCheckWinConditionHooks;
2728

2829
new g_pCvarRoundEndDelay;
2930

3031
public plugin_init() {
31-
register_plugin("[API] Rounds", "2.0.0", "Hedgehog Fog");
32+
register_plugin("[API] Rounds", "2.1.0", "Hedgehog Fog");
3233

3334
register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
3435
RegisterHookChain(RG_CSGameRules_RestartRound, "HC_RestartRound", .post = 0);
@@ -42,6 +43,7 @@ public plugin_init() {
4243
g_iFwRoundExpired = CreateMultiForward("Round_Fw_RoundExpired", ET_IGNORE);
4344
g_iFwRoundRestart = CreateMultiForward("Round_Fw_RoundRestart", ET_IGNORE);
4445
g_iFwRoundTimerTick = CreateMultiForward("Round_Fw_RoundTimerTick", ET_IGNORE);
46+
g_iFwCheckWinConditions = CreateMultiForward("Round_Fw_CheckWinCondition", ET_STOP);
4547

4648
g_irgCheckWinConditionHooks = ArrayCreate(Hook);
4749

@@ -140,6 +142,12 @@ public HC_CheckWinConditions() {
140142
}
141143
}
142144

145+
static iReturn;
146+
ExecuteForward(g_iFwCheckWinConditions, iReturn);
147+
if (iReturn != PLUGIN_CONTINUE) {
148+
return HC_SUPERCEDE;
149+
}
150+
143151
return HC_CONTINUE;
144152
}
145153

include/api_rounds.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ native Round_GetTime();
1111
native Round_GetTimeLeft();
1212
native bool:Round_IsRoundStarted();
1313
native bool:Round_IsRoundEnd();
14-
native Round_HookCheckWinConditions(szFunction[]);
1514

1615
forward Round_Fw_NewRound();
1716
forward Round_Fw_RoundStart();
1817
forward Round_Fw_RoundEnd(iWinnerTeam);
1918
forward Round_Fw_RoundExpired();
2019
forward Round_Fw_RoundRestart();
2120
forward Round_Fw_RoundTimerTick();
21+
forward Round_Fw_CheckWinCondition();
22+
23+
/**
24+
* @deprecated This function is deprecated, use Round_Fw_CheckWinCondition forward instead.
25+
*/
26+
native Round_HookCheckWinConditions(const szFunction[]);

0 commit comments

Comments
 (0)