]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/ctf.qc
Stop engine sounds on vehicle exit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / ctf.qc
index 0f9927760465059f9cad34893671a9c26f006003..09cb6c56819230111c91b70f7131ae2c0144026b 100644 (file)
@@ -173,7 +173,7 @@ void place_flag()
 
        setattachment(self, world, "");
        self.mdl = self.model;
-       self.flags = FL_ITEM;
+       self.flags = FL_ITEM | FL_NOTARGET;
        self.solid = SOLID_TRIGGER;
        self.movetype = MOVETYPE_NONE;
        self.velocity = '0 0 0';
@@ -234,7 +234,7 @@ void RegenFlag(entity e)
        e.angles = e.mangle;
        e.cnt = FLAG_BASE;
        e.owner = world;
-       e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
+       e.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
 };
 
 void ReturnFlag(entity e)
@@ -319,7 +319,7 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
                p.flagcarried = world;
        e.owner = world;
 
-       e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
+       e.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
        e.solid = SOLID_TRIGGER;
        e.movetype = MOVETYPE_TOSS;
        // setsize(e, '-16 -16 0', '16 16 74');
@@ -405,12 +405,18 @@ void FlagThink()
                DropFlag(self, world, world);
                return;
        }
-
-       if(autocvar_g_ctf_allow_drop)
-       if(e.BUTTON_USE)
-               DropFlag(self, e, world);
 };
 
+float ctf_usekey()
+{
+       if(self.flagcarried)
+       {
+               DropFlag(self.flagcarried, self, world);
+               return TRUE;
+       }
+       return FALSE;
+}
+
 void flag_cap_ring_spawn(vector org)
 {
        shockwave_spawn("models/ctf/shockwavetransring.md3", org - '0 0 15', -0.8, 0, 1);
@@ -549,7 +555,7 @@ void FlagTouch()
 
        if (self.cnt == FLAG_DROPPED)
        {
-               self.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
+               self.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
                if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
                {
                        // return flag