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 939c70e..03b2ec9 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;