X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Futils.qh;h=ae0c284fe5e0c626111fb3fa59415d5615dfc1be;hb=3e6e644488b54b638078fb88b88c643e103ac8e1;hp=e4dfe2afa4c305e18a15fe644e63a8425dee9364;hpb=d7ecf0b99095f97132ddb1252268ff7d7fb8597b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/utils.qh b/qcsrc/server/utils.qh index e4dfe2afa..ae0c284fe 100644 --- a/qcsrc/server/utils.qh +++ b/qcsrc/server/utils.qh @@ -23,6 +23,9 @@ const string STR_OBSERVER = "observer"; #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET) #define IS_MOVABLE(v) ((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v)) +#define IS_DEAD(s) ((s).deadflag != DEAD_NO) + +#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5))) // NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; }); // NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; }); @@ -55,18 +58,12 @@ bool _FCR_entered = false; _FCR_entered = true; \ int _cnt = 0; \ FOREACH_CLIENT(cond, { \ - int _j = floor(random() * (_cnt + 1)); \ - if (_j == _cnt) \ - { \ - _FCR_clients[_cnt] = it; \ - } \ - else \ - { \ - _FCR_clients[_cnt] = _FCR_clients[_j]; \ - _FCR_clients[_j] = it; \ - } \ - _cnt++; \ - }); \ + int _j = floor(random() * (_cnt + 1)); \ + if (_j != _cnt) \ + _FCR_clients[_cnt] = _FCR_clients[_j]; \ + _FCR_clients[_j] = it; \ + ++_cnt; \ + }); \ for (int _i = 0; _i < _cnt; ++_i) \ { \ const noref int i = _i; \