summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-05-04 02:04:27 +0200
committerHaru <haru@dotalux.com>2020-05-04 02:10:27 +0200
commit8a0a5d23f44ebb603fcd3bfc93089fc0d5f5d63c (patch)
tree0e2f94bf12bcf1b7e5692762dc73294b98f540b7
parent647a5e7ed42d9c711176bf34a6065823564dfa24 (diff)
downloadhercules-8a0a5d23f44ebb603fcd3bfc93089fc0d5f5d63c.tar.gz
hercules-8a0a5d23f44ebb603fcd3bfc93089fc0d5f5d63c.tar.bz2
hercules-8a0a5d23f44ebb603fcd3bfc93089fc0d5f5d63c.tar.xz
hercules-8a0a5d23f44ebb603fcd3bfc93089fc0d5f5d63c.zip
Add Assert_report to generate a backtrace on any skill_get_index failures
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/skill.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 2fae7e7f9..412023aac 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -129,6 +129,7 @@ static int skill_get_index(int skill_id)
if (skill_id < skill_idx_ranges[0].start || skill_id > skill_idx_ranges[length - 1].end) {
ShowWarning("skill_get_index: skill id '%d' is not being handled!\n", skill_id);
+ Assert_report(0);
return 0;
}
@@ -148,10 +149,12 @@ static int skill_get_index(int skill_id)
if (!found) {
ShowWarning("skill_get_index: skill id '%d' (idx: %d) is not handled as it lies outside the defined ranges!\n", skill_id, skill_idx);
+ Assert_report(0);
return 0;
}
if (skill_idx >= MAX_SKILL_DB) {
ShowWarning("skill_get_index: skill id '%d'(idx: %d) is not being handled as it exceeds MAX_SKILL_DB!\n", skill_id, skill_idx);
+ Assert_report(0);
return 0;
}