]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix area grid linking/unlinking of triggers and gametype ents in DP master
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 8 Apr 2023 19:01:08 +0000 (05:01 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sat, 8 Apr 2023 19:01:08 +0000 (05:01 +1000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/lib/warpzone/util_server.qc

index f8933bcb06afd22034aa155a1461af68fff2aa44..3f55143f6fd91064eae76ba83ba5fd0fc4dfdb04 100644 (file)
@@ -401,6 +401,7 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        GameRules_scoring_vip(player, true);
 
        // reset flag
+       flag.solid = SOLID_NOT; // before setorigin to prevent area grid linking
        if(player.vehicle)
        {
                setattachment(flag, player.vehicle, "");
@@ -414,7 +415,6 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        }
        set_movetype(flag, MOVETYPE_NONE);
        flag.takedamage = DAMAGE_NO;
-       flag.solid = SOLID_NOT;
        flag.angles = '0 0 0';
        flag.ctf_status = FLAG_CARRY;
 
@@ -467,11 +467,11 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype)
        // reset the flag
        setattachment(flag, NULL, "");
        tracebox(player.origin - FLAG_DROP_OFFSET, flag.m_mins, flag.m_maxs, player.origin + FLAG_DROP_OFFSET, MOVE_NOMONSTERS, flag);
+       flag.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
        setorigin(flag, trace_endpos);
        flag.owner.flagcarried = NULL;
        GameRules_scoring_vip(flag.owner, false);
        flag.owner = NULL;
-       flag.solid = SOLID_TRIGGER;
        flag.ctf_dropper = player;
        flag.ctf_droptime = time;
        flag.ctf_landtime = 0;
@@ -689,6 +689,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        flag.owner = player;
        player.flagcarried = flag;
        GameRules_scoring_vip(player, true);
+       flag.solid = SOLID_NOT; // before setorigin to prevent area grid linking
        if(player.vehicle)
        {
                setattachment(flag, player.vehicle, "");
@@ -704,7 +705,6 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        // flag setup
        set_movetype(flag, MOVETYPE_NONE);
        flag.takedamage = DAMAGE_NO;
-       flag.solid = SOLID_NOT;
        flag.angles = '0 0 0';
        flag.ctf_status = FLAG_CARRY;
 
@@ -1192,13 +1192,13 @@ void ctf_RespawnFlag(entity flag)
 
        // reset the flag
        setattachment(flag, NULL, "");
+       flag.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
        setorigin(flag, flag.ctf_spawnorigin);
 
        //set_movetype(flag, ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS)); // would be desired, except maps that want floating flags have it set to fall!
        set_movetype(flag, MOVETYPE_NONE); // match the initial setup handling (flag doesn't move when spawned)
        flag.takedamage = DAMAGE_NO;
        SetResourceExplicit(flag, RES_HEALTH, flag.max_health);
-       flag.solid = SOLID_TRIGGER;
        flag.velocity = '0 0 0';
        flag.angles = flag.mangle;
        flag.flags = FL_ITEM | FL_NOTARGET;
index 4ad694de826f374e42bfa59eea7861b4b096a5a9..8b024dbc7bd025bb13175d0ffb814f790c8e8c1b 100644 (file)
@@ -247,13 +247,13 @@ void ka_SpawnBall()
 {
        entity e = new(keepawayball);
        setmodel(e, MDL_KA_BALL);
+       e.solid = SOLID_TRIGGER; // before setsize to ensure area grid linking
        setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
        e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
        e.takedamage = DAMAGE_YES;
        e.event_damage = ka_DamageEvent;
        e.damagedbycontents = true;
        IL_PUSH(g_damagedbycontents, e);
-       e.solid = SOLID_TRIGGER;
        set_movetype(e, MOVETYPE_BOUNCE);
        e.glow_color = autocvar_g_keepawayball_trail_color;
        e.glow_trail = true;
index 1553bf5b4bc90f5f1319ae98a24519cac7108733..8396c1e619d0f80c1fca39db7197f224fbee26db 100644 (file)
@@ -215,6 +215,7 @@ vector kh_AttachedOrigin(entity e)  // runs when a team captures the flag, it ca
 
 void kh_Key_Attach(entity key)  // runs when a player picks up a key and several times when a key is assigned to a player at the start of a round
 {
+       key.solid = SOLID_NOT; // before setorigin to prevent area grid linking
 #ifdef KH_PLAYER_USE_ATTACHMENT
        entity first = key.owner.kh_next;
        if(key == first)
@@ -248,7 +249,6 @@ void kh_Key_Attach(entity key)  // runs when a player picks up a key and several
        key.flags = 0;
        if(IL_CONTAINS(g_items, key))
                IL_REMOVE(g_items, key);
-       key.solid = SOLID_NOT;
        set_movetype(key, MOVETYPE_NONE);
        key.team = key.owner.team;
        key.nextthink = time;
@@ -260,6 +260,7 @@ void kh_Key_Attach(entity key)  // runs when a player picks up a key and several
 
 void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs several times times when all the keys are captured
 {
+       key.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
 #ifdef KH_PLAYER_USE_ATTACHMENT
        entity first = key.owner.kh_next;
        if(key == first)
@@ -289,7 +290,6 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs
        key.flags = FL_ITEM;
        if(!IL_CONTAINS(g_items, key))
                IL_PUSH(g_items, key);
-       key.solid = SOLID_TRIGGER;
        set_movetype(key, MOVETYPE_TOSS);
        key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
        key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;
index cce889f89f780756250f64d9f9a0bb430d62ae29..7694f02fb6ade6a23c722f08785bc38ac97e9bd3 100644 (file)
@@ -108,23 +108,22 @@ void cpicon_construct(entity this, bool isnew)
 {
        this.netname = "Control Point Icon";
 
+       this.solid = SOLID_NOT; // before setmodel/setsize to prevent area grid linking
        setmodel(this, MDL_ONS_CP);
        setsize(this, CPICON_MIN, CPICON_MAX);
 
        if(this.icon_realmodel == NULL)
        {
                this.icon_realmodel = new(cpicon_model);
+               this.icon_realmodel.solid = SOLID_NOT;
                setmodel(this.icon_realmodel, MDL_Null);
                setorigin(this.icon_realmodel, this.origin);
                setsize(this.icon_realmodel, CPICON_MIN, CPICON_MAX);
                set_movetype(this.icon_realmodel, MOVETYPE_NOCLIP);
-               this.icon_realmodel.solid = SOLID_NOT;
        }
 
        if(this.iscaptured) { this.icon_realmodel.solid = SOLID_BBOX; }
 
-       set_movetype(this, MOVETYPE_NOCLIP);
-       this.solid                      = SOLID_NOT;
        set_movetype(this, MOVETYPE_NOCLIP);
        this.move_time          = time;
        this.drawmask           = MASK_NORMAL;
index 3a72c8d497d089417b33b18e6d4524741f6aea50..d8d28488abff4064c58969bc126b4b6f01d107b9 100644 (file)
@@ -157,10 +157,10 @@ void generator_construct(entity this, bool isnew)
 
        setorigin(this, this.origin);
        setmodel(this, MDL_ONS_GEN);
+       this.solid                      = SOLID_BBOX; // before setsize to ensure area grid linking
        setsize(this, GENERATOR_MIN, GENERATOR_MAX);
 
        set_movetype(this, MOVETYPE_NOCLIP);
-       this.solid                      = SOLID_BBOX;
        set_movetype(this, MOVETYPE_NOCLIP);
        this.move_time          = time;
        this.drawmask           = MASK_NORMAL;
index 7f2def318011cb2a17f497345a0ba09784483e75..e48ea346432df17c8ef9e9f7f69825d07ab34baa 100644 (file)
@@ -601,13 +601,13 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
 {
        entity e = new(onslaught_controlpoint_icon);
 
+       e.solid = SOLID_NOT; // before setsize/setorigin to prevent area grid linking
        setsize(e, CPICON_MIN, CPICON_MAX);
        setorigin(e, cp.origin + CPICON_OFFSET);
 
        e.owner = cp;
        e.max_health = autocvar_g_onslaught_cp_health;
        SetResourceExplicit(e, RES_HEALTH, autocvar_g_onslaught_cp_buildhealth);
-       e.solid = SOLID_NOT;
        e.takedamage = DAMAGE_AIM;
        e.bot_attack = true;
        IL_PUSH(g_bot_targets, e);
index 658716052f6e9d0f2865a12808328b4bb2e74870..5f1aebf490268365fdd74e3e6d1fd6da87417c2c 100644 (file)
@@ -40,11 +40,11 @@ void WarpZoneLib_ExactTrigger_Init(entity this)
                }
        }
        setorigin(this, this.origin);
+       this.solid = SOLID_TRIGGER; // before setsize to ensure area grid linking
        if(this.scale)
                setsize(this, this.mins * this.scale, this.maxs * this.scale);
        else
                setsize(this, this.mins, this.maxs);
        set_movetype(this, MOVETYPE_NONE);
-       this.solid = SOLID_TRIGGER;
        this.model = "";
 }