Game Display: avoid gameboard global ptr for get_visible_unit
This function is implemented identically, though const, in display_context (the base class of game_board). We don't need the non-const game_board function here.
This commit is contained in:
parent
0fbf068824
commit
28555f362f
1 changed files with 4 additions and 4 deletions
|
@ -118,12 +118,12 @@ void game_display::highlight_hex(map_location hex)
|
|||
{
|
||||
wb::future_map_if future(!synced_context::is_synced()); /**< Lasts for whole method. */
|
||||
|
||||
const unit *u = resources::gameboard->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
const unit *u = dc_->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
if (u) {
|
||||
displayedUnitHex_ = hex;
|
||||
invalidate_unit();
|
||||
} else {
|
||||
u = resources::gameboard->get_visible_unit(mouseoverHex_, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
u = dc_->get_visible_unit(mouseoverHex_, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
if (u) {
|
||||
// mouse moved from unit hex to non-unit hex
|
||||
if (dc_->units().count(selectedHex_)) {
|
||||
|
@ -145,7 +145,7 @@ void game_display::display_unit_hex(map_location hex)
|
|||
|
||||
wb::future_map_if future(!synced_context::is_synced()); /**< Lasts for whole method. */
|
||||
|
||||
const unit *u = resources::gameboard->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
const unit *u = dc_->get_visible_unit(hex, dc_->teams()[viewing_team()], !dont_show_all_);
|
||||
if (u) {
|
||||
displayedUnitHex_ = hex;
|
||||
invalidate_unit();
|
||||
|
@ -240,7 +240,7 @@ void game_display::draw_hex(const map_location& loc)
|
|||
|
||||
if(on_map && loc == mouseoverHex_ && !map_screenshot_) {
|
||||
drawing_layer hex_top_layer = drawing_layer::mouseover_bottom;
|
||||
const unit* u = resources::gameboard->get_visible_unit(loc, dc_->teams()[viewing_team()]);
|
||||
const unit* u = dc_->get_visible_unit(loc, dc_->teams()[viewing_team()]);
|
||||
if(u != nullptr) {
|
||||
hex_top_layer = drawing_layer::mouseover_top;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue