]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Do a trace when throwing the flag to ensure it isn't placed inside a solid ceiling
authorMario <mario.mario@y7mail.com>
Sat, 7 Sep 2019 15:10:03 +0000 (01:10 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 7 Sep 2019 15:10:50 +0000 (01:10 +1000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc

index 939c70e29ea858597260439a21ea3db98c19f78c..03b2ec9d1d428a3c7dfce3b0d3cbcb2d5fe05bd1 100644 (file)
@@ -440,7 +440,8 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype)
 
        // reset the flag
        setattachment(flag, NULL, "");
-       setorigin(flag, player.origin + FLAG_DROP_OFFSET);
+       tracebox(player.origin - FLAG_DROP_OFFSET, flag.m_mins, flag.m_maxs, player.origin + FLAG_DROP_OFFSET, MOVE_NOMONSTERS, flag);
+       setorigin(flag, trace_endpos);
        flag.owner.flagcarried = NULL;
        GameRules_scoring_vip(flag.owner, false);
        flag.owner = NULL;