X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fdamage.qc;h=e3660b21a295c01ce7a079187898f6bfba1b1d3b;hp=32849c2ac6d3858a738bbd92f4a89f3185a33d81;hb=82dbcadfd0556053b74638f2e3ae2e57103ddf26;hpb=bf825a0dada529d1288564e23223061429d01f31 diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 32849c2ac6..e3660b21a2 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -1,3 +1,19 @@ +#if defined(CSQC) + #include "../dpdefs/csprogsdefs.qh" + #include "defs.qh" + #include "../common/constants.qh" + #include "../common/util.qh" + #include "../common/weapons/weapons.qh" + #include "autocvars.qh" + #include "../common/deathtypes.qh" + #include "damage.qh" + #include "movetypes.qh" + #include "prandom.qh" + #include "vehicles/vehicles.qh" +#elif defined(MENUQC) +#elif defined(SVQC) +#endif + void DamageEffect_Think() { // if particle distribution is enabled, slow ticrate by total number of damages @@ -22,11 +38,7 @@ void DamageEffect_Think() return; } self.state = self.owner.csqcmodel_isdead; -#ifdef COMPAT_XON050_ENGINE - if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum || self.owner.entnum == spectatee_status) && !autocvar_chase_active) -#else if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum) && !autocvar_chase_active) -#endif return; // if we aren't using a third person camera, hide our own effects // now generate the particles @@ -35,11 +47,12 @@ void DamageEffect_Think() pointparticles(self.team, org, '0 0 0', 1); } -void DamageEffect(vector hitorg, float dmg, float type, float specnum) +void DamageEffect(vector hitorg, float dmg, int type, int specnum) { // particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets) - float life, nearestbone = 0; + int nearestbone = 0; + float life; string specstr, effectname; entity e; @@ -89,7 +102,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum) { specstr = species_prefix(specnum); specstr = substring(specstr, 0, strlen(specstr) - 1); - effectname = strreplace("BLOOD", specstr, effectname); + effectname = strreplace("BLOOD", specstr, effectname); } else { return; } // objects don't bleed } @@ -108,7 +121,9 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum) void Ent_DamageInfo(float isNew) { - float dmg, rad, edge, thisdmg, forcemul, species, hitplayer = FALSE; + float dmg, rad, edge, thisdmg; + bool hitplayer = false; + int species, forcemul; vector force, thisforce; entity oldself; @@ -118,9 +133,9 @@ void Ent_DamageInfo(float 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.x = ReadCoord(); + w_org.y = ReadCoord(); + w_org.z = ReadCoord(); dmg = ReadByte(); rad = ReadByte(); @@ -189,7 +204,7 @@ void Ent_DamageInfo(float isNew) DamageEffect(w_org, thisdmg, w_deathtype, species); if(self.isplayermodel) - hitplayer = TRUE; // this impact damaged a player + hitplayer = true; // this impact damaged a player } self = oldself; @@ -314,7 +329,7 @@ void Ent_DamageInfo(float isNew) pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1); break; - case DEATH_TURRET_WALK_MEELE: + case DEATH_TURRET_WALK_MELEE: sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1); break; @@ -333,9 +348,7 @@ void Ent_DamageInfo(float isNew) if(!DEATH_ISSPECIAL(w_deathtype)) if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit { - float hitwep; - - hitwep = DEATH_WEAPONOFWEAPONDEATH(w_deathtype); + int hitwep = DEATH_WEAPONOFWEAPONDEATH(w_deathtype); w_random = prandom(); traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); @@ -345,6 +358,6 @@ void Ent_DamageInfo(float isNew) w_backoff = -1 * normalize(force); setorigin(self, w_org + w_backoff * 2); // for sound() calls - WEP_ACTION(hitwep, WR_IMPACTEFFECT); + if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) { WEP_ACTION(hitwep, WR_IMPACTEFFECT); } } }