From ed2b41b716046bd8c1801f7a8d24a3086a5edbff Mon Sep 17 00:00:00 2001 From: Freddy Date: Tue, 13 Mar 2018 19:26:06 +0100 Subject: [PATCH] minor cleanup for jumppads --- qcsrc/common/triggers/spawnflags.qh | 2 +- qcsrc/common/triggers/trigger/jumppads.qc | 28 +++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/qcsrc/common/triggers/spawnflags.qh b/qcsrc/common/triggers/spawnflags.qh index c1ef338b2..c984ce114 100644 --- a/qcsrc/common/triggers/spawnflags.qh +++ b/qcsrc/common/triggers/spawnflags.qh @@ -59,7 +59,7 @@ const int TRAIN_TURN = BIT(1); const int TRAIN_NEEDACTIVATION = BIT(2); // jumppads -const int PUSH_ONCE = BIT(0); +const int PUSH_ONCE = BIT(0); // legacy, deactivate with relay instead const int PUSH_SILENT = BIT(1); // not used? // viewloc diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 53e93d4a2..198e3bf6e 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -8,7 +8,7 @@ void trigger_push_use(entity this, entity actor, entity trigger) if(teamplay) { this.team = actor.team; - this.SendFlags |= 2; + this.SendFlags |= SF_TRIGGER_UPDATE; } } #endif @@ -253,7 +253,7 @@ void trigger_push_touch(entity this, entity toucher) return; if(this.team) - if(((this.spawnflags & 4) == 0) == (DIFF_TEAM(this, toucher))) + if(((this.spawnflags & INVERT_TEAMS) == 0) == (DIFF_TEAM(this, toucher))) return; EXACTTRIGGER_TOUCH(this, toucher); @@ -480,7 +480,7 @@ float trigger_push_send(entity this, entity to, float sf) void trigger_push_updatelink(entity this) { - this.SendFlags |= 1; + this.SendFlags |= SF_TRIGGER_INIT; } void trigger_push_link(entity this) @@ -576,16 +576,30 @@ void target_push_init2(entity this) target_push_init(this); // normal push target behaviour can be combined with a legacy pusher? } -spawnfunc(target_push) { target_push_init2(this); } -spawnfunc(info_notnull) { target_push_init(this); } -spawnfunc(target_position) { target_push_init(this); } +spawnfunc(target_push) +{ + target_push_init2(this); +} + +spawnfunc(info_notnull) +{ + target_push_init(this); +} +spawnfunc(target_position) +{ + target_push_init(this); +} #elif defined(CSQC) NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew) { this.classname = "jumppad"; - int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; } + int mytm = ReadByte(); + if(mytm) + { + this.team = mytm - 1; + } this.spawnflags = ReadInt24_t(); this.active = ReadByte(); this.height = ReadCoord(); -- 2.39.2