]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix thrown/dropped gametype objectives getting stuck in solid
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 25 May 2023 02:47:41 +0000 (12:47 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 25 May 2023 02:47:41 +0000 (12:47 +1000)
This should have been included in
https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/1131

qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc

index d92dd0a3b99245f0d38553f429edbd3a248e0254..bdfab9cd1dbc97e20b4e1cabd7310019d7e59e47 100644 (file)
@@ -466,9 +466,9 @@ 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);
+       setorigin(flag, player.origin);
+       WarpZoneLib_MoveOutOfSolid(flag); // a flag has a bigger bbox than a player
        flag.owner.flagcarried = NULL;
        GameRules_scoring_vip(flag.owner, false);
        flag.owner = NULL;
index 8b024dbc7bd025bb13175d0ffb814f790c8e8c1b..f39885a284019b316fde73dc5e044d8622eb8679 100644 (file)
@@ -203,6 +203,7 @@ void ka_DropEvent(entity player) // runs any time that a player is supposed to l
        IL_PUSH(g_damagedbycontents, ball);
        ball.effects &= ~EF_NODRAW;
        setorigin(ball, player.origin + '0 0 10');
+       WarpZoneLib_MoveOutOfSolid(ball); // a ball has a bigger bbox than a player
        ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
        ball.owner = NULL;
        navigation_dynamicgoal_set(ball, player);
index ac0e4077448866615de97108810763f66473d32f..95beae1c7b5deead3e4f526a6739f1a7f7b36fe2 100644 (file)
@@ -288,6 +288,7 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs
        key.angles_y += key.owner.angles.y;
 #endif
        key.flags = FL_ITEM;
+       WarpZoneLib_MoveOutOfSolid(key); // a key has a bigger bbox than a player
        if(!IL_CONTAINS(g_items, key))
                IL_PUSH(g_items, key);
        set_movetype(key, MOVETYPE_TOSS);