Fix up the spatialmap to have an occupied_by method which checks if a square is occupied and returns what is there.

This commit is contained in:
Zed A. Shaw 2025-09-02 12:46:05 -04:00
parent 759f93cae0
commit a11e7de14e
7 changed files with 24 additions and 43 deletions

View file

@ -102,9 +102,7 @@ namespace gui {
void MainUI::render_mind_reading() {
auto level = GameDB::current_level();
if(level.collision->occupied($rayview->aiming_at)) {
auto entity = level.collision->get($rayview->aiming_at);
if(auto entity = level.collision->occupied_by($rayview->aiming_at)) {
if(auto enemy_ai = level.world->get_if<ai::EntityAI>(entity)) {
$overlay_ui.show_text("left", fmt::format(L"AI: {}",
guecs::to_wstring(enemy_ai->to_string())));