X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fsv_rules.qh;h=1b0f8a7bd89128fccc844f0fc05ccdf243608b91;hb=22d8d3278be0a17a489ec7365133360fffb47e02;hp=35a643d53b0eac3dde0e9d317f63667c0c7e5687;hpb=6ea97246f03651c514be506bf57cbc0c2351e935;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/sv_rules.qh b/qcsrc/common/gamemodes/sv_rules.qh index 35a643d53..1b0f8a7bd 100644 --- a/qcsrc/common/gamemodes/sv_rules.qh +++ b/qcsrc/common/gamemodes/sv_rules.qh @@ -1,5 +1,8 @@ #pragma once +// TODO: find a better location for these? +int total_players; + // todo: accept the number of teams as a parameter void GameRules_teams(bool value); @@ -28,14 +31,14 @@ void GameRules_limit_fallbacks(); * @param spprio player score priority (if frags aren't enabled) * @param stprio team score priority (if frags aren't enabled) */ -#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN { \ +#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN \ _GameRules_scoring_begin((teams), (spprio), (stprio)); \ noref void(entity, string, float) field = _GameRules_scoring_field; \ /* todo: just have the one `field` function */ \ noref void(int, string, float) field_team = _GameRules_scoring_field_team; \ LAMBDA(fields); \ _GameRules_scoring_end(); \ -} MACRO_END +MACRO_END void _GameRules_scoring_begin(int teams, float spprio, float stprio); void _GameRules_scoring_field(entity i, string label, int scoreflags);