summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 09:46:00 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 09:46:00 +0000
commitaf6dde3945128ffddf3e9b61c9ae9b9ab9064bc0 (patch)
tree376fe4493cf4ee40e9e08cf17df3bcb50331082f
parent1a33b2f941cbbf385eb9d578ce4e03bcd1d08e94 (diff)
downloadcrawl-ref-af6dde3945128ffddf3e9b61c9ae9b9ab9064bc0.tar.gz
crawl-ref-af6dde3945128ffddf3e9b61c9ae9b9ab9064bc0.zip
Fix explosions hitting their endpoint twice. [2481715]
As of now, explosion beams do not do affect anything until they actually explode. I can't think of any explosions that should do this, but I'm pretty sure there are some that I'm forgetting. Fix a security issue with crash dump reporting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8646 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abl-show.cc3
-rw-r--r--crawl-ref/source/beam.cc17
-rw-r--r--crawl-ref/source/debug.cc2
3 files changed, 19 insertions, 3 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index b64bb41064..8dbb11752d 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1116,7 +1116,8 @@ static bool _do_ability(const ability_def& abil)
return (false);
beam.range = spell_range(SPELL_FIREBALL, pow, true);
- fireball(pow, beam);
+ if (!fireball(pow, beam))
+ return (false);
}
// only one allowed since this is instantaneous -- bwr
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 346ba40798..5d91ed8880 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -181,7 +181,7 @@ static void _ench_animation( int flavour, const monsters *mon, bool force )
|| flavour == BEAM_BLINK) ? EC_WARP
: EC_ENCHANT;
- zap_animation( element_colour( elem ), mon, force );
+ zap_animation(element_colour(elem), mon, force);
}
// If needs_tracer is true, we need to check the beam path for friendly
@@ -2907,6 +2907,11 @@ bool bolt::found_player() const
void bolt::affect_ground()
{
+ // Explosions only have an effect during their explosion phase.
+ // Special cases can be handled here.
+ if (is_explosion && !in_explosion_phase)
+ return;
+
if (is_tracer)
return;
@@ -3743,6 +3748,11 @@ void bolt::affect_player_enchantment()
void bolt::affect_player()
{
+ // Explosions only have an effect during their explosion phase.
+ // Special cases can be handled here.
+ if (is_explosion && !in_explosion_phase)
+ return;
+
// Digging -- don't care.
if (flavour == BEAM_DIGGING)
return;
@@ -4326,6 +4336,11 @@ bool bolt::handle_statue_disintegration(monsters* mon)
void bolt::affect_monster(monsters* mon)
{
+ // Explosions only have an effect during their explosion phase.
+ // Special cases can be handled here.
+ if (is_explosion && !in_explosion_phase)
+ return;
+
// Don't hit dead monsters.
if (!mon->alive())
{
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 3dc09a671f..81bcfb5151 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -5571,7 +5571,7 @@ void do_crash_dump()
fprintf(file, EOL "Messages:" EOL);
fprintf(file, "<<<<<<<<<<<<<<<<<<<<<<" EOL);
std::string messages = get_last_messages(NUM_STORED_MESSAGES);
- fprintf(file, messages.c_str());
+ fprintf(file, "%s", messages.c_str());
fprintf(file, ">>>>>>>>>>>>>>>>>>>>>>" EOL);
}