X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ft_jumppads.qc;h=029bd8e5b6ed75b293cff51cf67367415b8cdfab;hb=0bb8d5706f4da165c323abeffedefa7971e18148;hp=cce0aab32bb5f062ca66a853f2a7996dfafef5c4;hpb=39c5a2ddb560b76d6134ee27da5096eb784eac25;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index cce0aab32..029bd8e5b 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -1,7 +1,8 @@ -float PUSH_ONCE = 1; -float PUSH_SILENT = 2; +const float PUSH_ONCE = 1; +const float PUSH_SILENT = 2; .float pushltime; +.float istypefrag; .float height; void() SUB_UseTargets; @@ -36,6 +37,8 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5; grav = autocvar_sv_gravity; + if(other.gravity) + grav *= other.gravity; zdist = torg_z - org_z; sdist = vlen(torg - org - zdist * '0 0 1'); @@ -68,7 +71,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) */ // push him so high... - vz = sqrt(2 * grav * jumpheight); // NOTE: sqrt(positive)! + vz = sqrt(fabs(2 * grav * jumpheight)); // NOTE: sqrt(positive)! // we start with downwards velocity only if it's a downjump and the jump apex should be outside the jump! if(ht < 0) @@ -134,7 +137,7 @@ void trigger_push_touch() return; if(self.team) - if((self.spawnflags & 4 == 0) == (self.team != other.team)) + if(((self.spawnflags & 4) == 0) == (self.team != other.team)) return; EXACTTRIGGER_TOUCH; @@ -161,9 +164,9 @@ void trigger_push_touch() other.velocity = self.movedir; } - other.flags &~= FL_ONGROUND; + other.flags &= ~FL_ONGROUND; - if (other.classname == "player") + if (IS_PLAYER(other)) { // reset tracking of oldvelocity for impact damage (sudden velocity changes) other.oldvelocity = other.velocity; @@ -172,12 +175,10 @@ void trigger_push_touch() { // flash when activated pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1); - sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM); + sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.pushltime = time + 0.2; } - float ct; - ct = clienttype(other); - if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT) + if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other)) { float i; float found; @@ -191,7 +192,7 @@ void trigger_push_touch() other.jumppadcount = other.jumppadcount + 1; } - if(ct == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(other)) { if(self.message) centerprint(other, self.message); @@ -199,20 +200,15 @@ void trigger_push_touch() else other.lastteleporttime = time; - if (!other.animstate_override) if (other.deadflag == DEAD_NO) - { - if (other.crouch) - setanim(other, other.anim_duckjump, FALSE, TRUE, TRUE); - else - setanim(other, other.anim_jump, FALSE, TRUE, TRUE); - } + animdecide_setaction(other, ANIMACTION_JUMP, TRUE); } else other.jumppadcount = TRUE; // reset tracking of who pushed you into a hazard (for kill credit) other.pushltime = 0; + other.istypefrag = 0; } if(self.enemy.target) @@ -244,7 +240,7 @@ void trigger_push_touch() if (self.spawnflags & PUSH_ONCE) { - self.touch = SUB_Null; + self.touch = func_null; self.think = SUB_Remove; self.nextthink = time; } @@ -286,7 +282,7 @@ void trigger_push_findtarget() else if(n == 1) { // exactly one dest - bots love that - self.enemy = find(e, targetname, self.target); + self.enemy = find(world, targetname, self.target); } else { @@ -333,7 +329,7 @@ void spawnfunc_trigger_push() self.speed = 1000; self.movedir = self.movedir * self.speed * 10; - if not(self.noise) + if (!self.noise) self.noise = "misc/jumppad.wav"; precache_sound (self.noise);