summaryrefslogtreecommitdiff
path: root/src/game/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r--src/game/game.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index d086cb6..3f64e0c 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -136,6 +136,21 @@ void state_t::command(v2f_t x)
}
}
+void state_t::spawn_soldier(v2f_t x)
+{
+ unit_soldier_t *soldier;
+ world::cmodel_t cmodel;
+
+ soldier = new unit_soldier_t(this);
+ soldier->place(&world, x);
+
+ cmodel.bounds = soldier->cmodel.bounds;
+ cmodel.cflags = soldier->move.cflags;
+
+ if (world.test_rect(&cmodel, soldier))
+ soldier->destroy();
+}
+
void state_t::tick(double now_, double dt_)
{
union {