summaryrefslogtreecommitdiff
path: root/src/game/game.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-18 17:33:49 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-18 17:33:49 +0000
commitc6489d36f6de7464c555f04d5d4324f50fa6c51f (patch)
treefde3f3d3a0d720a328f8b74ac2d0d14a0d463f02 /src/game/game.cpp
parent41bebb262aa8f346ce6cdaefd854c9077ae84f97 (diff)
Start experimenting with fear.
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r--src/game/game.cpp31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index e5f32f5..9d184ea 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -117,7 +117,10 @@ void state_t::command(v2f_t x)
if (unit->dead)
continue;
- if (!unit->start_moving(snap, CF_SOLID | CF_WATER))
+ if (!unit->controllable)
+ continue;
+
+ if (!unit->start_moving(snap))
unit->say(text::get(text::SAY_NO_PATH));
else
unit->say(text::get(text::SAY_MOVING));
@@ -152,32 +155,6 @@ void state_t::tick(double now_, double dt_)
}
}
-void state_t::wake_everything(v2f_t x, float range)
-{
- rectf_t wake_range;
-
- wake_range[0] = x - v2f_t(range, range);
- wake_range[1] = x + v2f_t(range, range);
-
- for (world::entity_t *went : world.get_entities(wake_range, -1)) {
- auto ent = dynamic_cast<game::entity_t*>(went);
-
- // WTF?
- if (!ent)
- continue;
-
- if (ent->ignore_waking)
- continue;
-
- ent->wake_time = now;
-
- if (ent->awake)
- continue;
-
- ent->wake();
- }
-}
-
die_t::die_t(size_t sides_)
{
sides = sides_;