]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Area grid linking fixes for DP master
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 31 May 2023 02:50:58 +0000 (02:50 +0000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 31 May 2023 02:50:58 +0000 (02:50 +0000)
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/server/portals.qc

index 7694f02fb6ade6a23c722f08785bc38ac97e9bd3..91a734f41f4be1171384fb3030d53b704a13addf 100644 (file)
@@ -122,7 +122,11 @@ void cpicon_construct(entity this, bool isnew)
                set_movetype(this.icon_realmodel, MOVETYPE_NOCLIP);
        }
 
-       if(this.iscaptured) { this.icon_realmodel.solid = SOLID_BBOX; }
+       if(this.iscaptured)
+       {
+               this.icon_realmodel.solid = SOLID_BBOX;
+               setorigin(this.icon_realmodel, this.icon_realmodel.origin); // link
+       }
 
        set_movetype(this, MOVETYPE_NOCLIP);
        this.move_time          = time;
index e48ea346432df17c8ef9e9f7f69825d07ab34baa..ea07659e340a078927c60ee163bb5f043fe57468 100644 (file)
@@ -555,6 +555,7 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
                sound(this, CH_TRIGGER, SND_ONS_CONTROLPOINT_BUILT, VOL_BASE, ATTEN_NORM);
                this.owner.iscaptured = true;
                this.solid = SOLID_BBOX;
+               setorigin(this, this.origin); // setorigin after change to solid field to ensure area grid linking
 
                Send_Effect(EFFECT_CAP(this.owner.team), this.owner.origin, '0 0 0', 1);
 
index aff0f764c7759c2955a527f55960725dca8526e6..219b23318c9ab6a68ae9be5f798de916b32659b9 100644 (file)
@@ -221,6 +221,8 @@ void turret_construct(entity this, bool isnew)
        setorigin(this, this.origin);
        _setmodel(this, tur.model);
        _setmodel(this.tur_head, tur.head_model);
+       this.solid = SOLID_BBOX; // before setsize so it will be linked to the area grid
+       this.tur_head.solid = SOLID_NOT;
        setsize(this, tur.m_mins, tur.m_maxs);
        setsize(this.tur_head, '0 0 0', '0 0 0');
 
@@ -235,8 +237,6 @@ void turret_construct(entity this, bool isnew)
        set_movetype(this, MOVETYPE_NOCLIP);
        this.tur_head.angles                    = this.angles;
        SetResourceExplicit(this, RES_HEALTH, 255);
-       this.solid                                              = SOLID_BBOX;
-       this.tur_head.solid                             = SOLID_NOT;
        set_movetype(this, MOVETYPE_NOCLIP);
        set_movetype(this.tur_head, MOVETYPE_NOCLIP);
        this.draw                                               = turret_draw;
index 2e6068bf56ac823cbefc287b163941447c19a7b8..1cca9b1ca1421778245bb3a38573b3cc6d04adb1 100644 (file)
@@ -304,6 +304,8 @@ void turret_respawn(entity this)
 
        Turret tur = get_turretinfo(this.m_id);
        tur.tr_setup(tur, this);
+
+       setorigin(this, this.origin); // make sure it's linked to the area grid
 }
 
 
index 139a3a364ffaadebef904987f0486f29b2af33c3..051ea0accd90ac3ebe3f91f699c200f4325c6b49 100644 (file)
@@ -209,7 +209,7 @@ void walker_fire_rocket(entity this, vector org)
 
     entity rocket = new(walker_rocket);
     setorigin(rocket, org);
-
+    rocket.solid                         = SOLID_BBOX; // before setsize so it will be linked to the area grid
     sound (this, CH_WEAPON_A, SND_HAGAR_FIRE, VOL_BASE, ATTEN_NORM);
     setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
@@ -238,7 +238,6 @@ void walker_fire_rocket(entity this, vector org)
     rocket.flags = FL_PROJECTILE;
     IL_PUSH(g_projectiles, rocket);
     IL_PUSH(g_bot_dodge, rocket);
-    rocket.solid                         = SOLID_BBOX;
     rocket.max_health           = time + 9;
     rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
 
index 302b39a0d16d66c12b6c328d992a710cd2d0c373..f18d867c60876c0f6b32d1ba9b5c130ba2d6074d 100644 (file)
@@ -819,8 +819,6 @@ void vehicles_exit(entity vehic, bool eject)
                        WriteAngle(MSG_ONE, 0);
                }
 
-               setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player));
-
                player.takedamage               = DAMAGE_AIM;
                player.solid                    = SOLID_SLIDEBOX;
                set_movetype(player, MOVETYPE_WALK);
@@ -840,6 +838,7 @@ void vehicles_exit(entity vehic, bool eject)
                }
                player.last_vehiclecheck = time + 3;
                player.vehicle_enter_delay = time + 2;
+               setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player));
 
                CSQCVehicleSetup(player, HUD_NORMAL);
 
index 8b34473e398a5894256e386200459a00eec45ada..a7fcafc38507d9dca2c7e7ef336c810c2e1d1e14 100644 (file)
@@ -238,7 +238,6 @@ void bumblebee_gunner_exit(entity this, int _exitflag)
        }
 
        CSQCVehicleSetup(player, HUD_NORMAL);
-       setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player));
 
        player.takedamage     = DAMAGE_AIM;
        player.solid          = SOLID_SLIDEBOX;
@@ -257,6 +256,7 @@ void bumblebee_gunner_exit(entity this, int _exitflag)
                delete(gunner.(weaponentity));
        }
        player.vehicle_enter_delay = time + 2;
+       setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player));
 
        fixedmakevectors(vehic.angles);
 
index dc219f571cc2322e1cb1b5f1a984ab209656fb0e..dc2f293d65fd533e0582bee09e38b0cf8aea3939 100644 (file)
@@ -66,6 +66,7 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
             setmodel(_flare, MDL_VEH_RAPTOR_FLARE);
             _flare.effects = EF_LOWPRECISION | EF_FLAME;
             _flare.scale = 0.5;
+            _flare.solid = SOLID_CORPSE; // before setorigin so it will be linked to the area grid
             setorigin(_flare, actor.origin - '0 0 16');
             set_movetype(_flare, MOVETYPE_TOSS);
             _flare.gravity = 0.15;
@@ -73,7 +74,6 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
             setthink(_flare, raptor_flare_think);
             _flare.nextthink = time;
             _flare.owner = veh ? veh : player;
-            _flare.solid = SOLID_CORPSE;
             _flare.takedamage = DAMAGE_YES;
             _flare.event_damage = raptor_flare_damage;
             SetResourceExplicit(_flare, RES_HEALTH, 20);
@@ -154,6 +154,7 @@ void raptor_bombdrop(entity this)
     entity bomb_2 = new(bombmount_right);
 
     vector org = gettaginfo(this, gettagindex(this, "bombmount_left"));
+    bomb_1.solid        = bomb_2.solid   = SOLID_BBOX; // before setorigin to ensure area grid linking
     setorigin(bomb_1, org);
     org = gettaginfo(this, gettagindex(this, "bombmount_right"));
     setorigin(bomb_2, org);
@@ -174,7 +175,6 @@ void raptor_bombdrop(entity this)
 
     bomb_1.owner        = bomb_2.owner   = this;
     bomb_1.realowner = bomb_2.realowner  = this.owner;
-    bomb_1.solid        = bomb_2.solid   = SOLID_BBOX;
     bomb_1.gravity   = bomb_2.gravity  = 1;
 
     PROJECTILE_MAKETRIGGER(bomb_1);
@@ -234,11 +234,11 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
 {
     entity sfrag = new(RaptorCBShellfrag);
     setmodel(sfrag, MDL_VEH_RAPTOR_CB_FRAGMENT);
+    sfrag.solid = SOLID_CORPSE; // before setorigin to ensure area grid linking
     setorigin(sfrag, _org);
 
     set_movetype(sfrag, MOVETYPE_BOUNCE);
     sfrag.gravity = 0.15;
-    sfrag.solid = SOLID_CORPSE;
 
     sfrag.draw = RaptorCBShellfragDraw;
     IL_PUSH(g_drawables, sfrag);
index d6a371b7652767b703c0493e3c87e31f4db7a5dc..460f6edf4bc377561c3a132c3b7eae032b977b4f 100644 (file)
@@ -418,10 +418,10 @@ void spiderbot_blowup(entity this)
        b.angles = this.angles;
        setsize(b, this.mins, this.maxs);
 
+       h.solid = SOLID_BBOX; // before setorigin for immediate area grid linking
        vector org = gettaginfo(this, gettagindex(this, "tag_head"));
        setorigin(h, org);
        set_movetype(h, MOVETYPE_BOUNCE);
-       h.solid = SOLID_BBOX;
        h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
        h.modelflags = MF_ROCKET;
        h.effects = EF_FLAME | EF_LOWPRECISION;
@@ -434,17 +434,17 @@ void spiderbot_blowup(entity this)
        setthink(h, spiderbot_headfade);
        h.nextthink = time;
 
+       g1.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
        org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint01"));
        setorigin(g1, org);
        set_movetype(g1, MOVETYPE_TOSS);
-       g1.solid = SOLID_CORPSE;
        g1.velocity = v_forward * 700 + (randomvec() * 32);
        g1.avelocity = randomvec() * 180;
 
+       g2.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
        org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint02"));
        setorigin(g2, org);
        set_movetype(g2, MOVETYPE_TOSS);
-       g2.solid = SOLID_CORPSE;
        g2.velocity = v_forward * 700 + (randomvec() * 32);
        g2.avelocity = randomvec() * 180;
 
index 2cf8db682f950e179f85f559d0997d6792765823..405d179ca8fce7cfd81b3c51f11447e903916cd6 100644 (file)
@@ -404,6 +404,7 @@ void Portal_Connect(entity teleporter, entity destination)
 #else
        teleporter.solid = SOLID_BSP;
 #endif
+       setorigin(teleporter, teleporter.origin); // link it to the area grid
 }
 
 void Portal_Remove(entity portal, float killed)