diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-18 17:33:49 +0000 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-18 17:33:49 +0000 |
commit | c6489d36f6de7464c555f04d5d4324f50fa6c51f (patch) | |
tree | fde3f3d3a0d720a328f8b74ac2d0d14a0d463f02 /src/game/game.cpp | |
parent | 41bebb262aa8f346ce6cdaefd854c9077ae84f97 (diff) |
Start experimenting with fear.
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r-- | src/game/game.cpp | 31 |
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_; |