]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_keyhunt.qc
Merge remote branch 'origin/master' into samual/mutator_ctf
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_keyhunt.qc
index 0dec6f485d8bfe3bbc44675aa2fee64020bacdaa..bc8e85f35da34fcec837b503c38df659ac5eacea 100644 (file)
@@ -412,6 +412,13 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deatht
 {
        if(self.owner)
                return;
+       if(ITEM_DAMAGE_NEEDKILL(deathtype))
+       {
+               // touching lava, or hurt trigger
+               // what shall we do?
+               // immediately return is bad
+               // maybe start a shorter countdown?
+       }
        if(vlen(force) <= 0)
                return;
        if(time > self.pushltime)
@@ -421,7 +428,7 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deatht
 
 void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped key
 {
-       sound(player, CHAN_AUTO, kh_sound_collect, VOL_BASE, ATTN_NORM);
+       sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTN_NORM);
 
        if(key.kh_dropperteam != player.team)
        {
@@ -441,6 +448,15 @@ void kh_Key_Touch()  // runs many, many times when a key has been dropped and ca
 
        if(self.owner) // already carried
                return;
+
+       if(ITEM_TOUCH_NEEDKILL())
+       {
+               // touching sky, or nodrop
+               // what shall we do?
+               // immediately return is bad
+               // maybe start a shorter countdown?
+       }
+
        if(other.classname != "player")
                return;
        if(other.deadflag != DEAD_NO)
@@ -672,7 +688,7 @@ void kh_Key_Think()  // runs all the time
        {
                if(self.siren_time < time)
                {
-                       sound(self.owner, CHAN_AUTO, kh_sound_alarm, VOL_BASE, ATTN_NORM);  // play a simple alarm
+                       sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTN_NORM);  // play a simple alarm
                        self.siren_time = time + 2.5;  // repeat every 2.5 seconds
                }
 
@@ -807,7 +823,7 @@ void kh_Key_DropOne(entity key)
        key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
        key.kh_dropperteam = key.team;
 
-       sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+       sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
 }
 
 void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
@@ -833,7 +849,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                        if(suicide)
                                key.kh_dropperteam = player.team;
                }
-               sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+               sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
        }
 }
 
@@ -1029,7 +1045,7 @@ MUTATOR_HOOKFUNCTION(kh_PlayerDies)
 {
        if(self == other)
                kh_Key_DropAll(self, TRUE);
-       else if(other.classname == "player" || other.classname == "gib")
+       else if(other.classname == "player")
                kh_Key_DropAll(self, FALSE);
        else
                kh_Key_DropAll(self, TRUE);