X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=4a226c7868b8afc55f19dbd2e37892cd1b4031dd;hb=5f9b25fac221d0fdbd2053786747c260a33857c6;hp=9317e234067ea69734a4e5bbeb36fb5d6564328a;hpb=6998d3c10219961585216b306e4e5b7c7c2e8b54;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 9317e2340..4a226c786 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -90,6 +90,7 @@ string STR_OBSERVER = "observer"; #define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(clienttype(v) == CLIENTTYPE_REAL) #define FOR_EACH_PLAYER(v) for(v = world; (v = find(v, classname, STR_PLAYER)) != world; ) #define FOR_EACH_REALPLAYER(v) FOR_EACH_PLAYER(v) if(clienttype(v) == CLIENTTYPE_REAL) +#define FOR_EACH_MONSTER(v) for(v = world; (v = findflags(v, flags, FL_MONSTER)) != world; ) #else #define FOR_EACH_CLIENTSLOT(v) for(v = world; (v = nextent(v)) && (num_for_edict(v) <= maxclients); ) #define FOR_EACH_CLIENT(v) FOR_EACH_CLIENTSLOT(v) if(v.flags & FL_CLIENT) @@ -97,6 +98,7 @@ string STR_OBSERVER = "observer"; #define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(v.classname == STR_PLAYER) #define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if(v.classname != STR_PLAYER) #define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(v.classname == STR_PLAYER) +#define FOR_EACH_MONSTER(v) for(v = world; (v = findflags(v, flags, FL_MONSTER)) != world; ) #endif #define CENTER_OR_VIEWOFS(ent) (ent.origin + ((ent.classname == STR_PLAYER) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5))) @@ -428,7 +430,7 @@ string formatmessage(string msg) else replacement = "batteries"; // ;) } else if (escape == "x") { replacement = cursor_ent.netname; - if (!replacement || !cursor_ent) + if (replacement == "" || !cursor_ent) replacement = "nothing"; } else if (escape == "s") replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1')); @@ -1115,6 +1117,8 @@ string GetGametype(); // g_world.qc void readlevelcvars(void) { g_minstagib = cvar("g_minstagib"); + + monster_skill = cvar("g_monsters_skill"); // load ALL the mutators if(cvar("g_dodging")) @@ -1140,6 +1144,9 @@ void readlevelcvars(void) // is this a mutator? is this a mode? if(cvar("g_sandbox")) MUTATOR_ADD(sandbox); + + if(cvar("g_za")) + MUTATOR_ADD(mutator_zombie_apocalypse); if(cvar("sv_allow_fullbright")) serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; @@ -1599,9 +1606,6 @@ void precache() precache_sound ("player/lava.wav"); precache_sound ("player/slime.wav"); - if (g_jetpack) - precache_sound ("misc/jetpack_fly.wav"); - precache_model ("models/sprites/0.spr32"); precache_model ("models/sprites/1.spr32"); precache_model ("models/sprites/2.spr32"); @@ -2528,43 +2532,6 @@ vector gettaginfo_relative(entity e, float tag) return gettaginfo(gettaginfo_relative_ent, tag); } -void SoundEntity_StartSound(entity pl, float chan, string samp, float vol, float attn) -{ - float p; - p = pow(2, chan); - if (pl.soundentity.cnt & p) - return; - soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn); - pl.soundentity.cnt |= p; -} - -void SoundEntity_StopSound(entity pl, float chan) -{ - float p; - p = pow(2, chan); - if (pl.soundentity.cnt & p) - { - stopsoundto(MSG_ALL, pl.soundentity, chan); - pl.soundentity.cnt &~= p; - } -} - -void SoundEntity_Attach(entity pl) -{ - pl.soundentity = spawn(); - pl.soundentity.classname = "soundentity"; - pl.soundentity.owner = pl; - setattachment(pl.soundentity, pl, ""); - setmodel(pl.soundentity, "null"); -} - -void SoundEntity_Detach(entity pl) -{ - float i; - for (i = 0; i <= 7; ++i) - SoundEntity_StopSound(pl, i); -} - .float scale2; float modeleffect_SendEntity(entity to, float sf)