From: TimePath Date: Wed, 2 Sep 2015 09:20:00 +0000 (+1000) Subject: Merge branch 'master' into TimePath/global_self X-Git-Tag: xonotic-v0.8.2~1931^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=802d673ea15260b02ce6760839cc40a2a57b21b1;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into TimePath/global_self # Conflicts: # qcsrc/server/mutators/gamemode_tdm.qc # qcsrc/server/mutators/mutator_campcheck.qc # qcsrc/server/mutators/mutator_instagib.qc # qcsrc/server/mutators/mutator_multijump.qc # qcsrc/server/mutators/mutator_nades.qc # qcsrc/server/mutators/mutator_new_toys.qc # qcsrc/server/mutators/mutator_spawn_near_teammate.qc # qcsrc/server/t_items.qc --- 802d673ea15260b02ce6760839cc40a2a57b21b1 diff --cc qcsrc/server/cl_client.qc index 5ba3d8667,4d7b9fa0b..fda43661c --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@@ -2651,8 -2661,9 +2651,9 @@@ Called every frame for each client afte */ .float idlekick_lasttimeleft; void PlayerPostThink (void) -{ +{SELFPARAM(); if(sv_maxidle > 0 && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero). + if(IS_REAL_CLIENT(self)) if(IS_PLAYER(self) || sv_maxidle_spectatorsareidle) { if (time - self.parm_idlesince < 1) // instead of (time == self.parm_idlesince) to support sv_maxidle <= 10 diff --cc qcsrc/server/mutators/gamemode_tdm.qc index 996857db5,fda2161a6..27cc19b0a --- a/qcsrc/server/mutators/gamemode_tdm.qc +++ b/qcsrc/server/mutators/gamemode_tdm.qc @@@ -9,8 -9,8 +9,8 @@@ Keys "netname" Name of the team (for example Red, Blue, Green, Yellow, Life, Death, Offense, Defense, etc)... "cnt" Scoreboard color of the team (for example 4 is red and 13 is blue)... */ void spawnfunc_tdm_team() -{ +{SELFPARAM(); - if(!g_tdm) { remove(self); return; } + if(!g_tdm || !self.cnt) { remove(self); return; } self.classname = "tdm_team"; self.team = self.cnt + 1; diff --cc qcsrc/server/mutators/mutator_campcheck.qc index 960565d42,2839ae09b..e4ad5ba19 --- a/qcsrc/server/mutators/mutator_campcheck.qc +++ b/qcsrc/server/mutators/mutator_campcheck.qc @@@ -8,8 -8,8 +8,8 @@@ .float campcheck_traveled_distance; MUTATOR_HOOKFUNCTION(campcheck_PlayerDies) -{ +{SELFPARAM(); - Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_CAMPCHECK); + Kill_Notification(NOTIF_ONE, self, MSG_CENTER_CPID, CPID_CAMPCHECK); return false; } @@@ -28,10 -28,15 +28,15 @@@ MUTATOR_HOOKFUNCTION(campcheck_PlayerDa } MUTATOR_HOOKFUNCTION(campcheck_PlayerThink) -{ +{SELFPARAM(); + if(!gameover) + if(!warmup_stage) // don't consider it camping during warmup? + if(time >= game_starttime) if(IS_PLAYER(self)) + if(IS_REAL_CLIENT(self)) // bots may camp, but that's no reason to constantly kill them if(self.deadflag == DEAD_NO) if(!self.frozen) + if(!self.BUTTON_CHAT) if(autocvar_g_campcheck_interval) { vector dist; diff --cc qcsrc/server/mutators/mutator_instagib.qc index 30810c82e,2e76d700e..384c29780 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@@ -335,10 -340,15 +340,13 @@@ MUTATOR_HOOKFUNCTION(instagib_FilterIte if(self.weapon == WEP_DEVASTATOR.m_id || self.weapon == WEP_VORTEX.m_id) { - entity e = spawn(), oldself; + entity e = spawn(); setorigin(e, self.origin); - oldself = self; - self = e; - self.noalign = oldself.noalign; - self.cnt = oldself.cnt; - self.team = oldself.team; - spawnfunc_item_minst_cells(); - self = oldself; ++ e.noalign = self.noalign; ++ e.cnt = self.cnt; ++ e.team = self.team; + SELFCALL(e, spawnfunc_item_minst_cells()); + SELFCALL_DONE(); return true; } diff --cc qcsrc/server/mutators/mutator_multijump.qc index 265ebea42,a5bb70b8e..04e60bb83 --- a/qcsrc/server/mutators/mutator_multijump.qc +++ b/qcsrc/server/mutators/mutator_multijump.qc @@@ -23,9 -28,11 +28,11 @@@ .float stat_multijump; .float stat_multijump_speed; .float stat_multijump_add; + .float stat_multijump_maxspeed; + .float stat_multijump_dodging; void multijump_UpdateStats() -{ +{SELFPARAM(); self.stat_multijump = PHYS_MULTIJUMP; self.stat_multijump_speed = PHYS_MULTIJUMP_SPEED; self.stat_multijump_add = PHYS_MULTIJUMP_ADD; @@@ -50,11 -61,20 +61,20 @@@ void PM_multijump( } } - float PM_multijump_checkjump() + bool PM_multijump_checkjump() -{ +{SELFPARAM(); if(!PHYS_MULTIJUMP) { return false; } - if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self)) // jump button pressed this frame and we are in midair + #ifdef SVQC + bool client_multijump = self.cvar_cl_multijump; + #elif defined(CSQC) + bool client_multijump = cvar("cl_multijump"); + + if(cvar("cl_multijump") > 1) + return false; // nope + #endif + + if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self) && client_multijump) // jump button pressed this frame and we are in midair self.multijump_ready = true; // this is necessary to check that we released the jump button and pressed it again else self.multijump_ready = false; diff --cc qcsrc/server/mutators/mutator_nades.qc index fcab3c769,0adff6068..8e49e2aa6 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@@ -794,7 -794,11 +794,11 @@@ float nade_customize( } void nade_prime() -{ +{SELFPARAM(); + if(autocvar_g_nades_bonus_only) + if(!self.bonus_nades) + return; // only allow bonus nades + if(self.nade) remove(self.nade); diff --cc qcsrc/server/mutators/mutator_new_toys.qc index c80f19f66,1d4beda65..172ee4d65 --- a/qcsrc/server/mutators/mutator_new_toys.qc +++ b/qcsrc/server/mutators/mutator_new_toys.qc @@@ -188,8 -189,8 +189,8 @@@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplac } MUTATOR_HOOKFUNCTION(nt_FilterItem) -{ +{SELFPARAM(); - if(nt_IsNewToy(self.weapon)) + if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) self.item_pickupsound = W_Sound("weaponpickup_new_toys"); return 0; } diff --cc qcsrc/server/mutators/mutator_spawn_near_teammate.qc index 899438d76,146487091..e3178b338 --- a/qcsrc/server/mutators/mutator_spawn_near_teammate.qc +++ b/qcsrc/server/mutators/mutator_spawn_near_teammate.qc @@@ -7,9 -7,11 +7,11 @@@ .float msnt_timer; .vector msnt_deathloc; + .float cvar_cl_spawn_near_teammate; + MUTATOR_HOOKFUNCTION(msnt_Spawn_Score) -{ +{SELFPARAM(); - if(autocvar_g_spawn_near_teammate_ignore_spawnpoint) + if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && self.cvar_cl_spawn_near_teammate)) return 0; entity p; @@@ -44,9 -46,9 +46,9 @@@ } MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn) -{ +{SELFPARAM(); // Note: when entering this, fixangle is already set. - if(autocvar_g_spawn_near_teammate_ignore_spawnpoint) + if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && self.cvar_cl_spawn_near_teammate)) { if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death) self.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death; diff --cc qcsrc/server/t_items.qc index 47165c773,5d392fd84..671f1d0ed --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@@ -75,8 -75,28 +75,28 @@@ void ItemDrawSimple( } } + void Item_PreDraw() + { + vector org; + float alph; + org = getpropertyvec(VF_ORIGIN); + if(!checkpvs(org, self)) // this makes sense as long as we don't support recursive warpzones + alph = 0; + else if(self.fade_start) + alph = bound(0, (self.fade_end - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.fade_end - self.fade_start), 1); + else + alph = 1; + //printf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs)); + if(self.ItemStatus & ITS_AVAILABLE) + self.alpha = alph; + if(alph <= 0) + self.drawmask = 0; + else + self.drawmask = MASK_NORMAL; + } + void ItemRead(float _IsNew) -{ +{SELFPARAM(); int sf = ReadByte(); if(sf & ISF_LOCATION) @@@ -229,11 -247,11 +247,11 @@@ #ifdef SVQC bool ItemSend(entity to, int sf) -{ +{SELFPARAM(); - if(self.gravity) - sf |= ISF_DROP; - else - sf &= ~ISF_DROP; + if(self.gravity) + sf |= ISF_DROP; + else + sf &= ~ISF_DROP; WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM); WriteByte(MSG_ENTITY, sf); @@@ -805,7 -833,8 +832,8 @@@ void Item_FindTeam( // Savage: used for item garbage-collection // TODO: perhaps nice special effect? void RemoveItem(void) -{ +{SELFPARAM(); + if(wasfreed(self) || !self) { return; } Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); remove(self); }