9 #define IS_PLAYER(v) ((v).classname == STR_PLAYER) 10 #define IS_SPEC(v) ((v).classname == STR_SPECTATOR) 11 #define IS_OBSERVER(v) ((v).classname == STR_OBSERVER) 13 #define IS_CLIENT(v) (v.flags & FL_CLIENT) 15 #define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT) 16 #define IS_FAKE_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT) 17 #define IS_REAL_CLIENT(v) (clienttype(v) == CLIENTTYPE_REAL) 19 #define IS_NOT_A_CLIENT(v) (!IS_CLIENT(v)) 21 #define IS_MONSTER(v) (v.flags & FL_MONSTER) 22 #define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE) 23 #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET) 25 #define IS_MOVABLE(v) ((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v)) 26 #define IS_DEAD(s) ((s).deadflag != DEAD_NO) 28 #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5))) 39 #define FOREACH_CLIENTSLOT(cond, body) \ 41 for(int _i = 1; _i <= maxclients; ++_i) \ 43 const noref int i = _i; \ 44 ITER_CONST noref entity it = ftoe(i); \ 45 if(cond) { LAMBDA(body) } \ 49 #define FOREACH_CLIENT(cond, body) FOREACH_CLIENTSLOT(IS_CLIENT(it) && (cond), LAMBDA(body)) 55 #define FOREACH_CLIENT_RANDOM(cond, body) \ 57 if (_FCR_entered) LOG_FATAL("FOREACH_CLIENT_RANDOM must not be nested"); \ 58 _FCR_entered = true; \ 60 FOREACH_CLIENT(cond, { \ 61 int _j = floor(random() * (_cnt + 1)); \ 63 _FCR_clients[_cnt] = _FCR_clients[_j]; \ 64 _FCR_clients[_j] = it; \ 67 for (int _i = 0; _i < _cnt; ++_i) \ 69 const noref int i = _i; \ 70 ITER_CONST noref entity it = _FCR_clients[i]; \ 71 if (cond) { LAMBDA(body) } \ 73 _FCR_entered = false; \ const string STR_SPECTATOR
const string STR_OBSERVER