]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Further cleanup of defs.qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 29588f8acce1c54f4cb4bf818239385a513b5850..f5d5f91bc43197cbf321a499fb17d5e5eb671e41 100644 (file)
@@ -3,14 +3,16 @@
 #include <common/effects/all.qh>
 #include "bot/api.qh"
 #include "g_hook.qh"
+#include <server/client.qh>
 #include <server/gamelog.qh>
+#include <server/items/items.qh>
 #include <server/mutators/_mod.qh>
+#include <server/sv_main.qh>
 #include "teamplay.qh"
 #include "scores.qh"
 #include "spawnpoints.qh"
 #include "../common/state.qh"
 #include "../common/physics/player.qh"
-#include "../common/t_items.qh"
 #include "resources.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/items/_mod.qh"
@@ -22,6 +24,8 @@
 #include "weapons/selection.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes/all.qh"
+#include <common/mapobjects/defs.qh>
+#include <common/mapobjects/triggers.qh>
 #include "../common/notifications/all.qh"
 #include "../common/physics/movetypes/movetypes.qh"
 #include "../common/playerstats.qh"
@@ -585,8 +589,8 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
 
        entity attacker_save = attacker;
 
-       // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
-       if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))
+       // special rule: gravity bombs and sound-based attacks do not affect team mates (other than for disconnecting the hook)
+       if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || (deathtype & HITTYPE_SOUND))
        {
                if(IS_PLAYER(targ) && SAME_TEAM(targ, attacker))
                {
@@ -861,7 +865,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                        farcent.nextthink = time + 0.1;
                        setthink(farcent, SUB_Remove);
                }
-               else
+               else if(targ.move_movetype != MOVETYPE_NOCLIP)
                {
                        targ.velocity = targ.velocity + farce;
                }
@@ -911,7 +915,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
        total_damage_to_creatures = 0;
 
        if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
-               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
+               if(!(deathtype & HITTYPE_SOUND)) // do not send radial sound damage (bandwidth hog)
                {
                        force = inflictorvelocity;
                        if(force == '0 0 0')