|
From: <gi...@cr...> - 2017-06-30 15:50:15
|
via 7bf63f6c59ec0b09b03f62e0b917198a2f13f101 (commit)
from a5031da894dc1155be9bdc1dee60503700e8f89a (commit)
-----------------------------------------------------------------------
commit 7bf63f6c59ec0b09b03f62e0b917198a2f13f101
Author: advil <ra...@gm...>
Date: Fri Jun 30 17:44:37 2017 +0200
Convert a segfault into an ASSERT failure
This is targeting a crash that can happen if a monster-thrown
penetration missile causes the attacker to die (e.g. via inner flame)
before other monsters are hit. The bug is hard to fix (would need to
save the attacker, or rewrite penetration) but this change is easy
enough.
See e.g.
http://crawl.berotato.org/crawl/morgue/Ofeo/crash-Ofeo-20170630-001453.txt
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/attack.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc
index f06a0bd..1c93e36 100644
--- a/crawl-ref/source/attack.cc
+++ b/crawl-ref/source/attack.cc
@@ -348,6 +348,7 @@ string attack::anon_pronoun(pronoun_type pron)
*/
void attack::init_attack(skill_type unarmed_skill, int attack_number)
{
+ ASSERT(attacker);
weapon = attacker->weapon(attack_number);
wpn_skill = weapon ? item_attack_skill(*weapon) : unarmed_skill;
--
Dungeon Crawl Stone Soup
|