From: Samual Lenks Date: Wed, 8 May 2013 03:09:03 +0000 (-0400) Subject: Try to fix off-by-one error in deathtype code X-Git-Tag: xonotic-v0.7.0~55^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=60dc72fcdd9e7f6b0cd901c8aa8c40bd577b55df;p=xonotic%2Fxonotic-data.pk3dir.git Try to fix off-by-one error in deathtype code --- diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index ca13f15a0..f9a9ceba2 100644 --- a/qcsrc/common/deathtypes.qh +++ b/qcsrc/common/deathtypes.qh @@ -69,7 +69,7 @@ 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) \ @@ -96,7 +96,7 @@ string Deathtype_Name(float deathtype) { if(DEATH_ISSPECIAL(deathtype)) { - entity deathent = deathtypes[(deathtype - DT_FIRST) - 1]; + entity deathent = deathtypes[(deathtype - DT_FIRST)]; if not(deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; } return deathent.nent_name; }