X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdeathtypes%2Fall.qh;fp=qcsrc%2Fcommon%2Fdeathtypes%2Fall.qh;h=abe1765bd0ec648664c790f3a14f0805e07e2302;hb=cf41044c9d897080866da6e0ca39d807e094e23e;hp=0466c230ab3b709f40343ce3d2bba3c2c3442894;hpb=43e59796e138c96dda6663007654bfe9496e391f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh index 0466c230a..abe1765bd 100644 --- a/qcsrc/common/deathtypes/all.qh +++ b/qcsrc/common/deathtypes/all.qh @@ -14,13 +14,14 @@ REGISTRY_CHECK(Deathtypes) int dt_identity(int i) { return i; } #define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra) \ - REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) { \ - this.m_id += DT_FIRST; \ - this.nent_name = #id; \ - this.death_msgextra = extra; \ - this.death_msgself = msg_death; \ - this.death_msgmurder = msg_death_by; \ - } + REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) \ + { \ + this.m_id += DT_FIRST; \ + this.nent_name = #id; \ + this.death_msgextra = extra; \ + this.death_msgself = msg_death; \ + this.death_msgmurder = msg_death_by; \ + } const int DEATH_WEAPONMASK = BITS(8); const int HITTYPE_SECONDARY = BITS(1) << 8; @@ -34,14 +35,14 @@ const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNC // normal deaths begin const int DT_FIRST = BIT(13); -#define DEATH_ISSPECIAL(t) (t >= DT_FIRST) -#define DEATH_IS(t, dt) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)) == dt) -#define DEATH_ENT(t) (DEATH_ISSPECIAL(t) ? (Deathtypes_from(t - DT_FIRST)) : NULL) -#define DEATH_ISVEHICLE(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "vehicle") -#define DEATH_ISTURRET(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "turret") -#define DEATH_ISMONSTER(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "monster") -#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? WEP_Null : Weapons_from((t) & DEATH_WEAPONMASK)) -#define DEATH_ISWEAPON(t, w) (DEATH_WEAPONOF(t) == (w)) +#define DEATH_ISSPECIAL(t) (t >= DT_FIRST) +#define DEATH_IS(t, dt) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)) == dt) +#define DEATH_ENT(t) (DEATH_ISSPECIAL(t) ? (Deathtypes_from(t - DT_FIRST)) : NULL) +#define DEATH_ISVEHICLE(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "vehicle") +#define DEATH_ISTURRET(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "turret") +#define DEATH_ISMONSTER(t) (DEATH_ISSPECIAL(t) && (Deathtypes_from(t - DT_FIRST)).death_msgextra == "monster") +#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? WEP_Null : Weapons_from((t) & DEATH_WEAPONMASK)) +#define DEATH_ISWEAPON(t, w) (DEATH_WEAPONOF(t) == (w)) string Deathtype_Name(int deathtype);