From 60dc72fcdd9e7f6b0cd901c8aa8c40bd577b55df Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 7 May 2013 23:09:03 -0400 Subject: [PATCH] Try to fix off-by-one error in deathtype code --- qcsrc/common/deathtypes.qh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index ca13f15a06..f9a9ceba25 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; } -- 2.39.2