X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fjumppads.qc;h=9e16c4ef06e128312859f57a16a3076cd10a9158;hb=a50c4f0676289e8ceb3a3df8bc84ad8f93085e61;hp=556fe66358ed00fae0eda7d5bd4786824b43f8d1;hpb=d271f27a5ac351a3a7b39636932f6d661492be1d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 556fe6635..9e16c4ef0 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -3,12 +3,12 @@ #include "jumppads.qh" #include -void trigger_push_use() -{SELFPARAM(); +void trigger_push_use(entity this, entity actor, entity trigger) +{ if(teamplay) { - self.team = activator.team; - self.SendFlags |= 2; + this.team = actor.team; + this.SendFlags |= 2; } } #endif @@ -129,8 +129,8 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht) return sdir * vs + '0 0 1' * vz; } -void trigger_push_touch() -{SELFPARAM(); +void trigger_push_touch(entity this) +{ if (this.active == ACTIVE_NOT) return; @@ -235,10 +235,7 @@ void trigger_push_touch() } if(this.enemy.target) - { - activator = other; - WITHSELF(this.enemy, SUB_UseTargets()); - } + SUB_UseTargets(this.enemy, other, other); // TODO: do we need other as trigger too? if (other.flags & FL_PROJECTILE) { @@ -265,15 +262,15 @@ void trigger_push_touch() if (this.spawnflags & PUSH_ONCE) { - this.touch = func_null; - this.think = SUB_Remove_self; + settouch(this, func_null); + setthink(this, SUB_Remove); this.nextthink = time; } #endif } #ifdef SVQC -void trigger_push_link(); +void trigger_push_link(entity this); void trigger_push_updatelink(entity this); #endif void trigger_push_findtarget(entity this) @@ -334,7 +331,7 @@ void trigger_push_findtarget(entity this) remove(e); } - trigger_push_link(); + trigger_push_link(this); defer(this, 0.1, trigger_push_updatelink); #endif } @@ -359,9 +356,8 @@ void trigger_push_updatelink(entity this) this.SendFlags |= 1; } -void trigger_push_link() +void trigger_push_link(entity this) { - SELFPARAM(); trigger_link(this, trigger_push_send); } @@ -385,7 +381,7 @@ spawnfunc(trigger_push) this.active = ACTIVE_ACTIVE; this.use = trigger_push_use; - this.touch = trigger_push_touch; + settouch(this, trigger_push_touch); // normal push setup if (!this.speed) @@ -440,21 +436,17 @@ spawnfunc(target_position) { target_push_init(this); } NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew) { - make_pure(this); - this.classname = "jumppad"; int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; } this.spawnflags = ReadInt24_t(); this.active = ReadByte(); this.height = ReadCoord(); - trigger_common_read(true); + trigger_common_read(this, true); this.entremove = trigger_remove_generic; this.solid = SOLID_TRIGGER; - //this.draw = trigger_draw_generic; - this.move_touch = trigger_push_touch; - this.drawmask = MASK_NORMAL; + settouch(this, trigger_push_touch); this.move_time = time; defer(this, 0.25, trigger_push_findtarget);