summaryrefslogtreecommitdiff
path: root/src/game/units.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-16 23:02:32 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-16 23:02:32 +0000
commit3d69504213f9788ced2ec18ceba9175b1ccb84dc (patch)
tree3ffb0fa9ae85eb487acfb1234b07e32f6721579d /src/game/units.cpp
parentc0531bd165643c8482e00ea04297498474be113e (diff)
Fix a bug in the waking code; more debugging info.
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r--src/game/units.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp
index 583dd11..0c03079 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -51,6 +51,27 @@ void unit_t::render_to(render::state_t *render)
render::ALIGN_CENTER_BOTTOM,
sf::Color::White);
}
+
+ if (debug_AI) {
+ v2f_t text_pos;
+ float height;
+ std::stringstream ss;
+
+ if (dead)
+ ss << "D";
+
+ if (awake)
+ ss << "A";
+ else
+ ss << "S";
+
+ text_pos = render_bounds[0] + v2f_t(render_bounds.dim(0) / 2, -render_bounds.dim(1) * 0.1);
+ height = size.dim_min() * 0.40f;
+ text_pos[1] -= height;
+ render->render_text(text_pos, height, ss.str(),
+ render::ALIGN_CENTER_BOTTOM,
+ sf::Color::White);
+ }
}
void unit_t::say(std::string str)