]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
STICKY spawnflag. When enabled, entities keep their gravity after leaving the gravity...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 3 May 2010 14:07:27 +0000 (17:07 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 3 May 2010 14:07:27 +0000 (17:07 +0300)
qcsrc/server/g_triggers.qc
scripts/entities.def

index 73b01901254ba450ee96480259d5e8e7bdb9d1db..446a4b7eb7fb22ada8c233293155eea2c252a269 100644 (file)
@@ -557,15 +557,18 @@ void trigger_gravity_touch()
 {
        EXACTTRIGGER_TOUCH;
 
-       if(!other.trigger_gravity_active)
+       if not(self.spawnflags & 1)
        {
-               other.trigger_gravity_active = 1;
-               other.trigger_gravity_check = spawn();
-               other.trigger_gravity_check.owner = other;
-               other.trigger_gravity_check.think = trigger_gravity_check_think;
-               other.trigger_gravity_check.nextthink = time;
+               if(!other.trigger_gravity_active)
+               {
+                       other.trigger_gravity_active = 1;
+                       other.trigger_gravity_check = spawn();
+                       other.trigger_gravity_check.owner = other;
+                       other.trigger_gravity_check.think = trigger_gravity_check_think;
+                       other.trigger_gravity_check.nextthink = time;
+               }
+               other.trigger_gravity_check.cnt = 2;
        }
-       other.trigger_gravity_check.cnt = 2;
 
        if (other.gravity != self.gravity)
        {
index 8bdf47ad8265d726cc56720c893472ad61dfab27..de58a37fdba04dca2455ff4ecf0ec8d96ae174a4 100644 (file)
@@ -1775,10 +1775,12 @@ Must target a target_position that indicates the view to be shown (and whose ang
 target: must point to a target_position
 */
 
-/*QUAKED trigger_gravity (.5 .5 1) ?
+/*QUAKED trigger_gravity (.5 .5 1) ? STICKY
 An area where gravity differs from the rest of the map.
 This acts as a modifier over the normal gravity (sv_gravity). eg: 0.5 is half the normal gravity, 2 is twice the normal gravity.
 -------- KEYS --------
 gravity: gravity offset in this area
 noise: sound to play when an entity enters the gravity zone, leave empty to disable
+-------- SPAWNFLAGS --------
+STICKY: entities keep their gravity after leaving the gravity zone
 */
\ No newline at end of file