]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc
Remove legacy Quake bbox expansion: KH
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / keyhunt / sv_keyhunt.qc
index 1553bf5b4bc90f5f1319ae98a24519cac7108733..0e79b58ebf6b40b96f2b28b2f4bf793f47f89b18 100644 (file)
@@ -45,8 +45,8 @@ const float KH_KEY_XYSPEED = 45;
 #endif
 const float KH_KEY_WP_ZSHIFT = 20;
 
-const vector KH_KEY_MIN = '-10 -10 -46';
-const vector KH_KEY_MAX = '10 10 3';
+const vector KH_KEY_MIN = '-25 -25 -46'; // 0.8.6 used '-10 -10 -46' with sv_legacy_bbox_expand 1 and FL_ITEM
+const vector KH_KEY_MAX = '25 25 4';     // 0.8.6 used '10 10 3'     with sv_legacy_bbox_expand 1 and FL_ITEM
 const float KH_KEY_BRIGHTNESS = 2;
 
 bool kh_no_radar_circles;
@@ -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,8 +290,8 @@ 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);
+       nudgeoutofsolid(key); // a key has a bigger bbox than a player
        key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
        key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;
        key.takedamage = DAMAGE_YES;