summaryrefslogtreecommitdiff
path: root/src/spells1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
committerBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
commita478b9be4e52f6a374d521565c55988cbf80c015 (patch)
tree461775d691ab2380acfed2e6c2ee63467a7ce423 /src/spells1.cc
parent23d4052eb88176ceb3cb3d769b09aa46a56e79cc (diff)
Move 'effects' global into Game struct
We change the type to std::vector<> while we're at it and make cave_type::effect to a boost::optional<>
Diffstat (limited to 'src/spells1.cc')
-rw-r--r--src/spells1.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/spells1.cc b/src/spells1.cc
index 7cdabda7..8fc4a23b 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -7898,8 +7898,6 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
/* Number of grids in the "blast area" (including the "beam" path) */
int grids = 0;
- int effect = 0;
-
/* Coordinates of the affected grids */
byte gx[1024], gy[1024];
@@ -8220,10 +8218,13 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
/* Start with "dist" of zero */
dist = 0;
+ /* Which effect? */
+ boost::optional<s16b> maybe_effect = boost::none;
+
/* Effect ? */
if (flg & PROJECT_STAY)
{
- effect = new_effect(typ, dam, project_time, p_ptr->py, p_ptr->px, rad, project_time_effect);
+ maybe_effect = new_effect(typ, dam, project_time, p_ptr->py, p_ptr->px, rad, project_time_effect);
project_time = 0;
project_time_effect = 0;
}
@@ -8244,7 +8245,7 @@ bool_ project(int who, int rad, int y, int x, int dam, int typ, int flg)
/* Effect ? */
if (flg & PROJECT_STAY)
{
- cave[y][x].effect = effect;
+ cave[y][x].maybe_effect = maybe_effect;
lite_spot(y, x);
}
}