diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-03-31 15:14:59 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-03-31 15:14:59 +0200 |
commit | d87217dffc1582b8dbed10da62b3b4d3f7b511de (patch) | |
tree | bccdf9809bff291b405d7625c33dbbcd60411256 /src/game/units.cpp | |
parent | aecfd089492b14a1b453f324a452946f5b20b043 (diff) |
Footstep sounds (not finished).
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r-- | src/game/units.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp index f3d53d7..30cfdd5 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -171,6 +171,7 @@ bool unit_t::start_moving(v2f_t dst) move.dst = dst; move.path.clear(); + move.last_step = x; rep.cflags = move.cflags & ~(cmodel.cflags); rep.bounds = cmodel.bounds; @@ -454,6 +455,11 @@ void unit_soldier_t::on_think(void) panic_turn = game->now + 0.3; } } + + if (move.moving && (x - move.last_step).len() > 0.5f) { + move.last_step = x; + assets::soldier.step_stone.play(); + } } void unit_soldier_t::on_death(void) |