X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fcounter.qc;h=5ada6805fc067ae7d4410ca29a5fb39f4ec8fd57;hb=42e255d014f2c6a1871177ea511f630624cdfb57;hp=9eb7eb072bb3f2fa61d0048a12c127f8e7c34b2b;hpb=5b22584122d4354ab7819853d0fa5219d14d832e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/counter.qc b/qcsrc/common/triggers/trigger/counter.qc index 9eb7eb072..5ada6805f 100644 --- a/qcsrc/common/triggers/trigger/counter.qc +++ b/qcsrc/common/triggers/trigger/counter.qc @@ -1,32 +1,32 @@ #ifdef SVQC -void counter_use() -{SELFPARAM(); - self.count -= 1; - if (self.count < 0) +void counter_use(entity this, entity actor, entity trigger) +{ + this.count -= 1; + if (this.count < 0) return; - if (self.count == 0) + if (this.count == 0) { - if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); + if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); - self.enemy = activator; - multi_trigger (); + this.enemy = actor; + WITHSELF(this, multi_trigger ()); } else { - if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - if(self.count >= 4) - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER); + if(IS_PLAYER(actor) && (this.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + if(this.count >= 4) + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER); else - Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count); + Send_Notification(NOTIF_ONE, actor, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, this.count); } } -void counter_reset() -{SELFPARAM(); - self.count = self.cnt; - multi_reset(); +void counter_reset(entity this) +{ + this.count = this.cnt; + multi_reset(this); } /*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage @@ -36,8 +36,8 @@ If nomessage is not set, t will print "1 more.. " etc when triggered and "sequen After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself. */ -void spawnfunc_trigger_counter() -{SELFPARAM(); +spawnfunc(trigger_counter) +{ self.wait = -1; if (!self.count) self.count = 2;