X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmapvoting.qc;h=ceb2cdd07850a884875e4895d71f614e3de7867e;hp=d22073ef6c5d02e25e50263a0ac643c085372aee;hb=a3a388a32d0ea11fe79341ef44edc21c5ba460f4;hpb=050fb0011ae5fb2b36c7c7f3d560f9453807a8ab diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index d22073ef6..ceb2cdd07 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" @@ -100,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]); } } @@ -454,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) { @@ -595,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(GetResource(it, RES_HEALTH) != 2342) { - it.health = 2342; + SetResourceExplicit(it, RES_HEALTH, 2342); CS(it).impulse = 0; msg_entity = it; @@ -621,7 +615,7 @@ void MapVote_Tick() if(it.mapvote) ++totalvotes; - )); + }); MapVote_CheckRules_1(); // just count }