summaryrefslogtreecommitdiff
path: root/src/game/effects.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-16 19:06:43 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-16 19:06:43 +0100
commit820e2e9d428c273e065cfe18b48c183a5cbedd75 (patch)
treee20a60780ecb4d7dbc53a641bdd86d3407c29577 /src/game/effects.cpp
parentc341559390ce52b47d056226fc102287dc41b304 (diff)
Major refactor of game's entity code.
Diffstat (limited to 'src/game/effects.cpp')
-rw-r--r--src/game/effects.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/effects.cpp b/src/game/effects.cpp
index d9215e3..8e7d2d7 100644
--- a/src/game/effects.cpp
+++ b/src/game/effects.cpp
@@ -2,9 +2,15 @@
namespace game {
-effect_t::effect_t(state_t *game_) : world::entity_t(ET_EFFECT)
+effect_t::effect_t(state_t *game_) : game::entity_t(game_, ET_EFFECT)
{
- game = game_;
+ always_awake = true;
+}
+
+void effect_t::on_think(void)
+{
+ if (game->now >= ttl)
+ destroy();
}
fx_tracer_t::fx_tracer_t(state_t *game_, v2f_t x0_, v2f_t x1_) : effect_t(game_)