X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Fqc%2Fdamageeffects.qc;h=1fc64d1d259697f7fb04c691a1d83ead70ef220f;hb=0df9efc608a567dcbff2f81680174626a43e78aa;hp=b53b605058a1fc340322ca225dcd33b500a044bc;hpb=12354d764a576f55a290ba11d9f34ccf4e3930d0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index b53b60505..1fc64d1d2 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -1,17 +1,4 @@ -#ifndef DAMAGEEFFECTS_H -#define DAMAGEEFFECTS_H - -#ifdef CSQC -#include -#include -#include -#include -#include -#endif - -#endif - -#ifdef IMPLEMENTATION +#include "damageeffects.qh" REGISTER_NET_LINKED(ENT_CLIENT_DAMAGEINFO) @@ -19,11 +6,10 @@ REGISTER_NET_LINKED(ENT_CLIENT_DAMAGEINFO) bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf) { + vector org = vec3(floor(this.origin.x), floor(this.origin.y), floor(this.origin.z)); WriteHeader(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO); WriteShort(MSG_ENTITY, this.projectiledeathtype); - WriteCoord(MSG_ENTITY, floor(this.origin.x)); - WriteCoord(MSG_ENTITY, floor(this.origin.y)); - WriteCoord(MSG_ENTITY, floor(this.origin.z)); + WriteVector(MSG_ENTITY, org); WriteByte(MSG_ENTITY, bound(1, this.dmg, 255)); WriteByte(MSG_ENTITY, bound(0, this.dmg_radius, 255)); WriteByte(MSG_ENTITY, bound(1, this.dmg_edge, 255)); @@ -81,7 +67,7 @@ void DamageEffect_Think(entity this) { // time is up or the player got gibbed / disconnected this.owner.total_damages = max(0, this.owner.total_damages - 1); - remove(this); + delete(this); return; } if(this.state && !this.owner.csqcmodel_isdead) @@ -89,7 +75,7 @@ void DamageEffect_Think(entity this) // if the player was dead but is now alive, it means he respawned // if so, clear his damage effects, or damages from his dead body will be copied back this.owner.total_damages = max(0, this.owner.total_damages - 1); - remove(this); + delete(this); return; } this.state = this.owner.csqcmodel_isdead; @@ -200,9 +186,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) w_issilent = (w_deathtype & 0x8000); w_deathtype = (w_deathtype & 0x7FFF); - w_org.x = ReadCoord(); - w_org.y = ReadCoord(); - w_org.z = ReadCoord(); + w_org = ReadVector(); thedamage = ReadByte(); rad = ReadByte(); @@ -255,7 +239,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) if(it.damageforcescale) if(vdist(thisforce, !=, 0)) { - it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, autocvar_g_balance_damagepush_speedfactor); + it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, damagepush_speedfactor); UNSET_ONGROUND(it); } @@ -401,6 +385,8 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) } } + MUTATOR_CALLHOOK(DamageInfo, this, w_deathtype, w_org); + // TODO spawn particle effects and sounds based on w_deathtype if(!DEATH_ISSPECIAL(w_deathtype)) if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit @@ -424,5 +410,3 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) } #endif - -#endif