X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdeathtypes.qh;h=4f96f7500eb96fe1faa8a584bdfdbd34de932cf3;hb=9e9ae52d6c468d5bbd43df53e54fc8d6c7276175;hp=ca13f15a063e2fc674465312ebe1b600a1e88bd3;hpb=3aed354c1125db3e6e862f552c253b06b09d5d86;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index ca13f15a0..4f96f7500 100644 --- a/qcsrc/common/deathtypes.qh +++ b/qcsrc/common/deathtypes.qh @@ -15,6 +15,7 @@ DEATHTYPE(DEATH_KILL, DEATH_SELF_SUICIDE, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_LAVA, DEATH_SELF_LAVA, DEATH_MURDER_LAVA, NORMAL_POS) \ DEATHTYPE(DEATH_MIRRORDAMAGE, DEATH_SELF_BETRAYAL, NO_MSG, NORMAL_POS) \ + DEATHTYPE(DEATH_NADE, DEATH_SELF_NADE, DEATH_MURDER_NADE, NORMAL_POS) \ DEATHTYPE(DEATH_NOAMMO, DEATH_SELF_NOAMMO, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_ROT, DEATH_SELF_ROT, NO_MSG, NORMAL_POS) \ DEATHTYPE(DEATH_SHOOTING_STAR, DEATH_SELF_SHOOTING_STAR, DEATH_MURDER_SHOOTING_STAR, NORMAL_POS) \ @@ -69,17 +70,15 @@ entity deathtypes[DT_MAX]; CHECK_MAX_COUNT(name, DT_MAX, DT_COUNT, "deathtypes") \ \ entity deathent = spawn(); \ - deathtypes[(name - DT_FIRST) - 1] = deathent; \ + deathtypes[(name - DT_FIRST)] = deathent; \ deathent.classname = "deathtype"; \ deathent.nent_name = #name; \ - #if (msg_death != NO_MSG) \ + if (msg_death != NO_MSG) \ deathent.death_msgself = msg_multi_notifs[msg_death - 1]; \ - #endif \ - #if (msg_death_by != NO_MSG) \ + if (msg_death_by != NO_MSG) \ deathent.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \ - #endif \ } \ - ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name) + ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name); DEATHTYPES #undef DEATHTYPE @@ -96,17 +95,17 @@ string Deathtype_Name(float deathtype) { if(DEATH_ISSPECIAL(deathtype)) { - entity deathent = deathtypes[(deathtype - DT_FIRST) - 1]; - if not(deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; } + entity deathent = deathtypes[(deathtype - DT_FIRST)]; + if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; } return deathent.nent_name; } else { return ftos(deathtype); } } -float DEATH_WEAPONMASK = 0xFF; -float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths -float HITTYPE_SECONDARY = 0x100; -float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage -float HITTYPE_BOUNCE = 0x400; -float HITTYPE_RESERVED2 = 0x800; -float HITTYPE_RESERVED = 0x1000; // unused yet +const float DEATH_WEAPONMASK = 0xFF; +const float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths +const float HITTYPE_SECONDARY = 0x100; +const float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage +const float HITTYPE_BOUNCE = 0x400; +const float HITTYPE_RESERVED2 = 0x800; +const float HITTYPE_RESERVED = 0x1000; // unused yet