X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmapvoting.qc;h=5c564d56db45fc7baeabeb9c6fd22240cc4263df;hb=d46f774178c3d0025b5942a2f170519182897297;hp=7ccb2a30b72205e9c2471b1c54ccbd177c153ee3;hpb=d5634fe916916ac8c4ab0984240ac1bf0547e1b3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 7ccb2a30b..5c564d56d 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -1,5 +1,7 @@ #include "mapvoting.qh" +#include +#include #include "g_world.qh" #include "command/cmd.qh" #include "command/getreplies.qh" @@ -7,6 +9,7 @@ #include #include "../common/mapinfo.qh" #include "../common/playerstats.qh" +#include #include "../common/util.qh" @@ -99,23 +102,15 @@ string GameTypeVote_MapInfo_FixName(string m) void MapVote_ClearAllVotes() { - FOREACH_CLIENT(true, LAMBDA(it.mapvote = 0)); + FOREACH_CLIENT(true, { it.mapvote = 0; }); } void MapVote_UnzoneStrings() { for(int j = 0; j < mapvote_count; ++j) { - if ( mapvote_maps[j] ) - { - strunzone(mapvote_maps[j]); - mapvote_maps[j] = string_null; - } - if ( mapvote_maps_pakfile[j] ) - { - strunzone(mapvote_maps_pakfile[j]); - mapvote_maps_pakfile[j] = string_null; - } + strfree(mapvote_maps[j]); + strfree(mapvote_maps_pakfile[j]); } } @@ -453,7 +448,7 @@ bool MapVote_Finished(int mappos) GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos])); } - FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(FixClientCvars(it))); + FOREACH_CLIENT(IS_REAL_CLIENT(it), { FixClientCvars(it); }); if(gametypevote) { @@ -594,11 +589,11 @@ void MapVote_Tick() return; int totalvotes = 0; - FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA( + FOREACH_CLIENT(IS_REAL_CLIENT(it), { // hide scoreboard again - if(it.health != 2342) + if(GetResourceAmount(it, RESOURCE_HEALTH) != 2342) { - it.health = 2342; + SetResourceAmountExplicit(it, RESOURCE_HEALTH, 2342); CS(it).impulse = 0; msg_entity = it; @@ -620,7 +615,7 @@ void MapVote_Tick() if(it.mapvote) ++totalvotes; - )); + }); MapVote_CheckRules_1(); // just count }