X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmapvoting.qc;h=5c564d56db45fc7baeabeb9c6fd22240cc4263df;hb=83c3e8fd619985fe7c4f74d3affaa97ac46c448e;hp=638b40f65e52f18580b46c5ab890e2e3a4fc118b;hpb=264c9f48d418d1ebd4b5ef5868b85f92644917dc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 638b40f65..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,12 +589,12 @@ 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; - it.impulse = 0; + SetResourceAmountExplicit(it, RESOURCE_HEALTH, 2342); + CS(it).impulse = 0; msg_entity = it; WriteByte(MSG_ONE, SVC_FINALE); @@ -610,17 +605,17 @@ void MapVote_Tick() if ( !(mapvote_maps_flags[it.mapvote-1] & GTV_AVAILABLE) ) it.mapvote = 0; // use impulses as new vote - if(it.impulse >= 1 && it.impulse <= mapvote_count) - if( mapvote_maps_flags[it.impulse - 1] & GTV_AVAILABLE ) + if(CS(it).impulse >= 1 && CS(it).impulse <= mapvote_count) + if( mapvote_maps_flags[CS(it).impulse - 1] & GTV_AVAILABLE ) { - it.mapvote = it.impulse; + it.mapvote = CS(it).impulse; MapVote_TouchVotes(it); } - it.impulse = 0; + CS(it).impulse = 0; if(it.mapvote) ++totalvotes; - )); + }); MapVote_CheckRules_1(); // just count }