From: Mario Date: Thu, 5 Feb 2015 04:38:18 +0000 (+1100) Subject: Merge branch 'master' into Mario/physics X-Git-Tag: xonotic-v0.8.1~48^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=128cea32714586feb51b4a0d78a6bd4e35fef9f2;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/physics Conflicts: qcsrc/server/autocvars.qh qcsrc/server/cl_physics.qc qcsrc/server/mutators/mutator_buffs.qc qcsrc/server/mutators/mutator_buffs.qh --- 128cea32714586feb51b4a0d78a6bd4e35fef9f2 diff --cc qcsrc/server/autocvars.qh index d30ebdbe4a,bcb9d28d70..8ec8e71f72 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@@ -582,8 -585,20 +585,8 @@@ float autocvar_skill_auto float autocvar_snd_soundradius; float autocvar_spawn_debug; float autocvar_speedmeter; - var float autocvar_sv_accuracy_data_share = 1; -float autocvar_sv_accelerate; + float autocvar_sv_accuracy_data_share = 1; string autocvar_sv_adminnick; -float autocvar_sv_airaccel_qw; -float autocvar_sv_airaccel_qw_stretchfactor; -float autocvar_sv_airaccel_sideways_friction; -float autocvar_sv_airaccelerate; -float autocvar_sv_aircontrol; -float autocvar_sv_aircontrol_penalty; -float autocvar_sv_aircontrol_power; -float autocvar_sv_airspeedlimit_nonqw; -float autocvar_sv_airstopaccelerate; -float autocvar_sv_airstrafeaccel_qw; -float autocvar_sv_airstrafeaccelerate; float autocvar_sv_autoscreenshot; float autocvar_sv_cheats; float autocvar_sv_clientcommand_antispam_time; @@@ -861,3 -882,4 +864,5 @@@ float autocvar_g_buffs_vampire_damage_s float autocvar_g_buffs_invisible_alpha; float autocvar_g_buffs_flight_gravity; float autocvar_g_buffs_jump_height; ++ + #endif diff --cc qcsrc/server/cl_physics.qc index 2e29f88b7a,337342333c..81c3cfd8b2 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@@ -45,13 -47,13 +71,13 @@@ returns true if handle float PlayerJump (void) { if(self.frozen) - return TRUE; // no jumping in freezetag when frozen + return true; // no jumping in freezetag when frozen if(self.player_blocked) - return TRUE; // no jumping while blocked + return true; // no jumping while blocked - float doublejump = FALSE; - float doublejump = false; - float mjumpheight = autocvar_sv_jumpvelocity; ++ bool doublejump = false; + float mjumpheight = self.stat_sv_jumpvelocity; player_multijump = doublejump; player_jumpheight = mjumpheight; @@@ -491,9 -493,9 +517,9 @@@ void CPM_PM_Aircontrol(vector wishdir, return; #endif - k *= bound(0, wishspeed / autocvar_sv_maxairspeed, 1); + k *= bound(0, wishspeed / self.stat_sv_maxairspeed, 1); - zspeed = self.velocity_z; + zspeed = self.velocity.z; self.velocity_z = 0; xyspeed = vlen(self.velocity); self.velocity = normalize(self.velocity); @@@ -1008,10 -988,10 +1033,10 @@@ void SV_PlayerPhysics( // noclipping or flying self.flags &= ~FL_ONGROUND; - self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction); + self.velocity = self.velocity * (1 - frametime * self.stat_sv_friction); makevectors(self.v_angle); //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; + wishvel = v_forward * self.movement.x + v_right * self.movement.y + '0 0 1' * self.movement.z; // acceleration wishdir = normalize(wishvel); wishspeed = vlen(wishvel); @@@ -1058,10 -1038,10 +1083,10 @@@ self.velocity_z += g; } - self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction); + self.velocity = self.velocity * (1 - frametime * self.stat_sv_friction); makevectors(self.v_angle); //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; + wishvel = v_forward * self.movement.x + v_right * self.movement.y + '0 0 1' * self.movement.z; self.velocity_z += g; if (self.ladder_entity.classname == "func_water") { @@@ -1098,9 -1078,9 +1123,9 @@@ { //makevectors(self.v_angle_y * '0 1 0'); makevectors(self.v_angle); - wishvel = v_forward * self.movement_x + v_right * self.movement_y; + wishvel = v_forward * self.movement.x + v_right * self.movement.y; // add remaining speed as Z component - maxairspd = autocvar_sv_maxairspeed*max(1, maxspd_mod); + maxairspd = self.stat_sv_maxairspeed*max(1, maxspd_mod); // fix speedhacks :P wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1); // add the unused velocity as up component @@@ -1274,12 -1254,12 +1299,12 @@@ } else { - maxairspd = autocvar_sv_maxairspeed; - airaccel = autocvar_sv_airaccelerate; + maxairspd = self.stat_sv_maxairspeed; + airaccel = self.stat_sv_airaccelerate; } // airborn - makevectors(self.v_angle_y * '0 1 0'); - wishvel = v_forward * self.movement_x + v_right * self.movement_y; + makevectors(self.v_angle.y * '0 1 0'); + wishvel = v_forward * self.movement.x + v_right * self.movement.y; // acceleration wishdir = normalize(wishvel); wishspeed = wishspeed0 = vlen(wishvel); @@@ -1305,9 -1285,9 +1330,9 @@@ { vector curdir; curdir = self.velocity; - curdir_z = 0; + curdir.z = 0; curdir = normalize(curdir); - airaccel = airaccel + (autocvar_sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir)); + airaccel = airaccel + (self.stat_sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir)); } // note that for straight forward jumping: // step = accel * frametime * wishspeed0; @@@ -1326,12 -1306,12 +1351,12 @@@ airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw)); // !CPM - if(self.stat_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0) - if(autocvar_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement.x != 0) ++ if(self.stat_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement.x != 0) PM_AirAccelerate(wishdir, wishspeed); else - PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_qw_stretchfactor, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw); + PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, self.stat_sv_airaccel_qw_stretchfactor, self.stat_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw); - if(autocvar_sv_aircontrol) + if(self.stat_sv_aircontrol) CPM_PM_Aircontrol(wishdir, wishspeed2); } } diff --cc qcsrc/server/defs.qh index e175e94180,175179b507..38d02b3b51 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@@ -447,32 -452,9 +452,32 @@@ float round_starttime; //point in time .float stat_sv_airspeedlimit_nonqw; .float stat_sv_maxspeed; +// new properties +.float stat_sv_jumpvelocity; +.float stat_sv_airaccel_qw_stretchfactor; +.float stat_sv_maxairstrafespeed; +.float stat_sv_maxairspeed; +.float stat_sv_airstrafeaccelerate; +.float stat_sv_warsowbunny_turnaccel; +.float stat_sv_airaccel_sideways_friction; +.float stat_sv_aircontrol; +.float stat_sv_aircontrol_power; +.float stat_sv_aircontrol_penalty; +.float stat_sv_warsowbunny_airforwardaccel; +.float stat_sv_warsowbunny_topspeed; +.float stat_sv_warsowbunny_accel; +.float stat_sv_warsowbunny_backtosideratio; +.float stat_sv_friction; +.float stat_sv_accelerate; +.float stat_sv_stopspeed; +.float stat_sv_airaccelerate; +.float stat_sv_airstopaccelerate; + +.string cvar_cl_physics; + void W_Porto_Remove (entity p); - .float projectiledeathtype; + .int projectiledeathtype; .string message2; diff --cc qcsrc/server/mutators/mutator_buffs.qc index 4da3e1a14c,b2f800a27e..333d5192e2 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@@ -457,8 -457,9 +457,8 @@@ MUTATOR_HOOKFUNCTION(buffs_PlayerJump { if(self.buffs & BUFF_JUMP) player_jumpheight = autocvar_g_buffs_jump_height; - self.stat_jumpheight = player_jumpheight; - return FALSE; + return false; } MUTATOR_HOOKFUNCTION(buffs_MonsterMove) @@@ -748,7 -749,8 +748,7 @@@ void buffs_Initialize( precache_sound("keepaway/respawn.wav"); addstat(STAT_BUFFS, AS_INT, buffs); - - addstat(STAT_MOVEVARS_JUMPVELOCITY, AS_FLOAT, stat_jumpheight); + InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET); }