From e5c81f2eb214fa05410b6d15e19454c885004b7b Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 9 Aug 2025 11:09:08 -0500 Subject: [PATCH] move is_sign to boe.locutils --- src/game/boe.actions.cpp | 8 -------- src/game/boe.actions.hpp | 1 - src/game/boe.locutils.cpp | 6 +++++- src/game/boe.locutils.hpp | 1 + 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 77368b15..4f0a3bad 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -692,7 +692,6 @@ void handle_look(location destination, bool right_button, eKeyMod mods, bool& ne if(adj_town_look(destination)) need_redraw = true; // TODO: This would be the place to call OUT_LOOK special - // TODO: Do we really need an is_sign function? if(is_sign(ter_looked_at)) { print_buf(); need_reprint = false; @@ -4273,13 +4272,6 @@ short count_walls(location loc) { // TODO: Generalize this function return answer; } -bool is_sign(ter_num_t ter) { - - if(univ.scenario.ter_types[ter].special == eTerSpec::IS_A_SIGN) - return true; - return false; -} - bool check_for_interrupt(std::string confirm_dialog){ using kb = sf::Keyboard; bool interrupt = false; diff --git a/src/game/boe.actions.hpp b/src/game/boe.actions.hpp index b722c90d..bf8b26be 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -54,7 +54,6 @@ short nearest_monster(); void setup_outdoors(location where); short get_outdoor_num(); short count_walls(location loc); -bool is_sign(ter_num_t ter); bool check_for_interrupt(std::string confirm_dialog = "confirm-interrupt-special"); void handle_startup_button_click(eStartButton btn, eKeyMod mods); diff --git a/src/game/boe.locutils.cpp b/src/game/boe.locutils.cpp index bf0778f7..bc3bf436 100644 --- a/src/game/boe.locutils.cpp +++ b/src/game/boe.locutils.cpp @@ -612,4 +612,8 @@ bool vehicle_is_here(const cVehicle& vehicle) { }else{ return vehicle.which_town == univ.party.town_num; } -} \ No newline at end of file +} + +bool is_sign(ter_num_t ter) { + return univ.scenario.ter_types[ter].special == eTerSpec::IS_A_SIGN; +} diff --git a/src/game/boe.locutils.hpp b/src/game/boe.locutils.hpp index c61cdfd9..3adcfb3a 100644 --- a/src/game/boe.locutils.hpp +++ b/src/game/boe.locutils.hpp @@ -36,6 +36,7 @@ bool outd_is_special(location to_check); bool impassable(ter_num_t terrain_to_check); short get_blockage(ter_num_t terrain_type); short light_radius(); +bool is_sign(ter_num_t ter); bool pt_in_light(location from_where,location to_where) ;// Assumes, of course, in town or combat bool combat_pt_in_light(location to_where); bool party_sees_a_monst(); // Returns true is a hostile monster is in sight.