X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=e8972ca8e4c75c317bbfceea7495d2e80451abaa;hb=7ac0b97ab2ffbeec850e622df8bf9af77a1a349d;hp=20828800deebfdd3d7d0407269179ec0037489a8;hpb=8a000d27bdf428db93e0304c4fdee5a26b89e9e8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 20828800d..e8972ca8e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -428,7 +428,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')); @@ -1107,10 +1107,6 @@ float g_touchexplode_force; float sv_autotaunt; float sv_taunt; -float sv_pitch_min; -float sv_pitch_max; -float sv_pitch_fixyaw; - string GetGametype(); // g_world.qc void readlevelcvars(void) { @@ -1121,6 +1117,8 @@ void readlevelcvars(void) MUTATOR_ADD(mutator_dodging); if(cvar("g_spawn_near_teammate")) MUTATOR_ADD(mutator_spawn_near_teammate); + if(cvar("g_physical_items")) + MUTATOR_ADD(mutator_physical_items); if(!g_minstagib) { if(cvar("g_invincible_projectiles")) @@ -1265,10 +1263,6 @@ void readlevelcvars(void) if not(inWarmupStage && !g_ca) game_starttime = cvar("g_start_delay"); - sv_pitch_min = cvar("sv_pitch_min"); - sv_pitch_max = cvar("sv_pitch_max"); - sv_pitch_fixyaw = cvar("sv_pitch_fixyaw"); - readplayerstartcvars(); } @@ -1599,9 +1593,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"); @@ -1824,7 +1815,7 @@ void InitializeEntitiesRun() self = e_old; } //dprint("Delayed initialization: ", self.classname, "\n"); - if(func != func_null) + if(func) func(); else { @@ -1838,7 +1829,6 @@ void InitializeEntitiesRun() .float uncustomizeentityforclient_set; .void(void) uncustomizeentityforclient; -void(void) SUB_Nullpointer = #0; void UncustomizeEntitiesRun() { entity oldself; @@ -1851,7 +1841,7 @@ void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer) { e.customizeentityforclient = customizer; e.uncustomizeentityforclient = uncustomizer; - e.uncustomizeentityforclient_set = (uncustomizer != SUB_Nullpointer); + e.uncustomizeentityforclient_set = !!uncustomizer; } .float nottargeted; @@ -2410,8 +2400,8 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float { if (visual) { - vecs_y = 0; - vecs_z -= 2; + if (autocvar_g_shootfromclient) { vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); } + else { vecs_y = 0; vecs_z -= 2; } } else { @@ -2529,43 +2519,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)