]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
prevent dropship routes through playerclip
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 23 Jan 2022 17:06:39 +0000 (18:06 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 23 Jan 2022 17:06:39 +0000 (18:06 +0100)
qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc

index 60960e54ca2efb76f9f1377aa9dd79e5b32ac5f0..4750ad72bbb15ea519fd96e4171983c4a294cc6b 100644 (file)
@@ -12,7 +12,7 @@ entity dropship_initialize()
 {
     entity this = dropship_spawn(VEH_RACER, autocvar_g_br_dropship_scale, autocvar_g_br_dropship_color);
 
-    bool moveSucceeded = MoveToRandomLocationWithinBounds(this, world.mins, world.maxs, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 2500, 8192, 1024);
+    bool moveSucceeded = MoveToRandomLocationWithinBounds(this, world.mins, world.maxs, this.dphitcontentsmask, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 2500, 8192, 1024);
     if(!moveSucceeded)
     {
         delete(this);
@@ -65,6 +65,8 @@ entity dropship_spawn(Vehicle info, float entity_scale, vector color)
     this.vehicleid              = info.vehicleid;
     this.vehicledef             = info;
     this.dphitcontentsmask      = DPCONTENTS_SOLID;
+    if(autocvar_g_playerclip_collisions)
+        this.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
     this.flags                  = FL_NOTARGET;
     this.nextthink              = time;
     setthink(this, dropship_think);