]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
minor cleanup for jumppads
authorFreddy <schro.sb@gmail.com>
Tue, 13 Mar 2018 18:26:06 +0000 (19:26 +0100)
committerFreddy <schro.sb@gmail.com>
Tue, 13 Mar 2018 18:26:06 +0000 (19:26 +0100)
qcsrc/common/triggers/spawnflags.qh
qcsrc/common/triggers/trigger/jumppads.qc

index c1ef338b262660dd5f1784a4a6721e56d8924352..c984ce114b1133e0ab92690bf65b4d2cb32c7ad4 100644 (file)
@@ -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
index 53e93d4a2c3a7a3ea3028edfc3d84fc5d61787f6..198e3bf6ebc4c17426e6685e538f558adc08668b 100644 (file)
@@ -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();