From: Mircea Kitsune Date: Mon, 3 May 2010 14:07:27 +0000 (+0300) Subject: STICKY spawnflag. When enabled, entities keep their gravity after leaving the gravity... X-Git-Tag: xonotic-v0.1.0preview~640^2~11^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2cd493b0eb7f101e8e1eb9e78a18f61330598588;p=xonotic%2Fxonotic-data.pk3dir.git STICKY spawnflag. When enabled, entities keep their gravity after leaving the gravity zone. Good for maps where you need to go get lighter before you can jump over an obstacle (given you don't have push weapons at that time) --- diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 73b0190125..446a4b7eb7 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -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) { diff --git a/scripts/entities.def b/scripts/entities.def index 8bdf47ad82..de58a37fdb 100644 --- a/scripts/entities.def +++ b/scripts/entities.def @@ -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