summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/arena.cc2
-rw-r--r--crawl-ref/source/beam.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index db02ef669e..67b8e9413f 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -92,7 +92,7 @@ namespace arena
void alert_faction(bool friendly)
{
- int alerter;
+ int alerter = 0;
for (int i = 0; i < MAX_MONSTERS; i++)
{
const monsters *mon = &menv[i];
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 2295fe8b61..8af120c8b2 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -16,6 +16,7 @@
#include <iostream>
#include <set>
#include <algorithm>
+#include <cmath>
#ifdef DOS
#include <dos.h>
@@ -1408,7 +1409,7 @@ static void _munge_bounced_bolt(bolt &old_bolt, bolt &new_bolt,
double old_deg = old_ray.get_degrees();
double new_deg = new_ray.get_degrees();
- double angle = abs(old_deg - new_deg);
+ double angle = fabs(old_deg - new_deg);
if (angle >= 180.0)
angle -= 180.0;
@@ -1421,7 +1422,8 @@ static void _munge_bounced_bolt(bolt &old_bolt, bolt &new_bolt,
ray_def temp_ray = new_ray;
for (int tries = 0; tries < 20; tries++)
{
- shift = (double) random_range(min * 10000, max * 10000) / 10000.0;
+ shift = (double) random_range((int)(min * 10000),
+ (int)(max * 10000)) / 10000.0;
if (new_deg < old_deg)
shift = -shift;