summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index c50a3fb..65f0a2c 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -182,6 +182,11 @@ bool unit_t::start_moving(v2f_t dst, world::cflags_t cflags)
void unit_t::damage(int points, unit_t *attacker)
{
+ fx_blood_t *blood;
+
+ blood = new fx_blood_t(game, x, type == UNIT_ALIEN);
+ game->add_effect(blood);
+
health -= points;
if (health < 0) {
game->interface->print(name + " " + text::get(text::UNIT_DEATH) + ".");
@@ -294,16 +299,16 @@ void human_t::think(void)
if (last_attack + 1.5 < game->now) {
world::trace_t trace;
+ fx_tracer_t *tracer;
+
+ tracer = new fx_tracer_t(game, x, target->x);
+ game->add_effect(tracer);
+ std::cout << tracer->cmodel.bounds << std::endl;
trace = world->trace(x, target->x, CF_SOLID);
if (!trace.hit) {
- fx_tracer_t *tracer;
-
last_attack = game->now;
try_attack(target);
-
- tracer = new fx_tracer_t(game, x, target->x);
- game->add_effect(tracer);
}
}