]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/damage.qc
Fix kicked player not receiving the kick message (if sent with Send_Notification)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / damage.qc
index b983cdb8aa2e11c26e002a4438a487983c3ef99c..7e052de046ebbbd5f93dc6ef2f071b306f85623f 100644 (file)
@@ -1,42 +1,43 @@
 #include "damage.qh"
 
+#include <common/constants.qh>
+#include <common/deathtypes/all.qh>
 #include <common/effects/all.qh>
-#include "bot/api.qh"
-#include "hook.qh"
+#include <common/gamemodes/_mod.qh>
+#include <common/gamemodes/rules.qh>
+#include <common/items/_mod.qh>
+#include <common/mapobjects/defs.qh>
+#include <common/mapobjects/triggers.qh>
+#include <common/mutators/mutator/buffs/buffs.qh>
+#include <common/mutators/mutator/instagib/sv_instagib.qh>
+#include <common/mutators/mutator/waypoints/waypointsprites.qh>
+#include <common/notifications/all.qh>
+#include <common/physics/movetypes/movetypes.qh>
+#include <common/physics/player.qh>
+#include <common/playerstats.qh>
+#include <common/state.qh>
+#include <common/teams.qh>
+#include <common/util.qh>
+#include <common/vehicles/all.qh>
+#include <common/weapons/_all.qh>
+#include <lib/csqcmodel/sv_model.qh>
+#include <lib/warpzone/common.qh>
+#include <server/bot/api.qh>
 #include <server/client.qh>
 #include <server/gamelog.qh>
+#include <server/hook.qh>
 #include <server/items/items.qh>
-#include <server/mutators/_mod.qh>
 #include <server/main.qh>
+#include <server/mutators/_mod.qh>
+#include <server/resources.qh>
+#include <server/scores.qh>
+#include <server/spawnpoints.qh>
+#include <server/teamplay.qh>
+#include <server/weapons/accuracy.qh>
+#include <server/weapons/csqcprojectile.qh>
+#include <server/weapons/selection.qh>
+#include <server/weapons/weaponsystem.qh>
 #include <server/world.qh>
-#include "teamplay.qh"
-#include "scores.qh"
-#include "spawnpoints.qh"
-#include "../common/state.qh"
-#include "../common/physics/player.qh"
-#include "resources.qh"
-#include "../common/vehicles/all.qh"
-#include "../common/items/_mod.qh"
-#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
-#include "../common/mutators/mutator/instagib/sv_instagib.qh"
-#include "../common/mutators/mutator/buffs/buffs.qh"
-#include "weapons/accuracy.qh"
-#include "weapons/csqcprojectile.qh"
-#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"
-#include "../common/teams.qh"
-#include "../common/util.qh"
-#include <common/gamemodes/_mod.qh>
-#include <common/gamemodes/rules.qh>
-#include <common/weapons/_all.qh>
-#include "../lib/csqcmodel/sv_model.qh"
-#include "../lib/warpzone/common.qh"
 
 void UpdateFrags(entity player, int f)
 {
@@ -282,7 +283,9 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en
                                                Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
                                                break;
                                        }
-
+                                       case DEATH_HURTTRIGGER:
+                                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, inflictor.message, deathlocation, CS(targ).killcount, 0, 0);
+                                               break;
                                        default:
                                        {
                                                Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
@@ -817,8 +820,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                                                                attacker.damage_dealt += damage;
                                                }
 
-                                               damage_goodhits += 1;
-                                               damage_gooddamage += damage;
+                                               impressive_hits += 1;
 
                                                if (!DEATH_ISSPECIAL(deathtype))
                                                {
@@ -887,9 +889,9 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
        }
 }
 
+// Returns total damage applies to creatures
 float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe,
                                                                float inflictorselfdamage, float forceintensity, float forcezscale, int deathtype, .entity weaponentity, entity directhitentity)
-       // Returns total damage applies to creatures
 {
        entity  targ;
        vector  force;
@@ -1228,6 +1230,10 @@ void Fire_ApplyDamage(entity e)
        float t, d, hi, ty;
        entity o;
 
+       // water, slime and ice stop fire
+       if (STAT(FROZEN, e) || (e.waterlevel && (e.watertype != CONTENT_LAVA)))
+               e.fire_endtime = 0;
+
        if (!Fire_IsBurning(e))
                return;
 
@@ -1235,15 +1241,6 @@ void Fire_ApplyDamage(entity e)
        if(IS_NOT_A_CLIENT(o))
                o = e.fire_owner;
 
-       // water and slime stop fire
-       if(e.waterlevel)
-       if(e.watertype != CONTENT_LAVA)
-               e.fire_endtime = 0;
-
-       // ice stops fire
-       if(STAT(FROZEN, e))
-               e.fire_endtime = 0;
-
        t = min(frametime, e.fire_endtime - time);
        d = e.fire_damagepersec * t;