Stop creating invisible pseudo-haloes for [item]s

It makes halo code significantly easier to debug in the test scenario
when there isn't dozens of these around.
This commit is contained in:
Jyrki Vesterinen 2017-11-12 19:16:33 +02:00
parent c9c0a9e762
commit f065b91708

View file

@ -107,8 +107,11 @@ void display::parse_team_overlays()
void display::add_overlay(const map_location& loc, const std::string& img, const std::string& halo, const std::string& team_name, const std::string& item_id, bool visible_under_fog)
{
if (halo_man_) {
const halo::handle halo_handle = halo_man_->add(get_location_x(loc) + hex_size() / 2,
get_location_y(loc) + hex_size() / 2, halo, loc);
halo::handle halo_handle;
if(halo != "") {
halo_handle = halo_man_->add(get_location_x(loc) + hex_size() / 2,
get_location_y(loc) + hex_size() / 2, halo, loc);
}
overlays_->emplace(loc, overlay(img, halo, halo_handle, team_name, item_id, visible_under_fog));
}