X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdeathtypes%2Fall.qh;h=b662b7e76feb041f960def35e8f224b59495bea9;hb=f6aef4f937fde258e3cd8c7a05f7deb908a044c8;hp=42aa6bb52b29ddd568bb8a180b5eb9c1303aded4;hpb=719ba01817465b96db552e18c7f277721d8dbb7e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh index 42aa6bb52..b662b7e76 100644 --- a/qcsrc/common/deathtypes/all.qh +++ b/qcsrc/common/deathtypes/all.qh @@ -5,20 +5,22 @@ REGISTRY(Deathtypes, BITS(8)) #define Deathtypes_from(i) _Deathtypes_from(i, NULL) -REGISTER_REGISTRY(RegisterDeathtypes) +REGISTER_REGISTRY(Deathtypes) +REGISTRY_CHECK(Deathtypes) .entity death_msgself; .entity death_msgmurder; .string death_msgextra; +int dt_identity(int i) { return i; } + #define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra) \ - REGISTER(RegisterDeathtypes, DEATH, Deathtypes, id, m_id, new(deathtype)) { \ - make_pure(this); \ + REGISTER(Deathtypes, DEATH, id, m_id, new_pure(deathtype)) { \ this.m_id += DT_FIRST; \ this.nent_name = #id; \ this.death_msgextra = extra; \ - if (msg_death != NO_MSG) this.death_msgself = msg_multi_notifs[msg_death - 1]; \ - if (msg_death_by != NO_MSG) this.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \ + if (msg_death != NO_MSG) this.death_msgself = msg_multi_notifs[dt_identity(msg_death - 1)]; \ + if (msg_death_by != NO_MSG) this.death_msgmurder = msg_multi_notifs[dt_identity(msg_death_by - 1)]; \ } const int DEATH_WEAPONMASK = BITS(8); @@ -39,7 +41,7 @@ const int DT_FIRST = BIT(13); #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 : get_weaponinfo((t) & DEATH_WEAPONMASK)) +#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);