[Commits] [wesnoth/wesnoth] a1fe59: Fix #2273: map labels aren't drawn in the editor

GitHub noreply at github.com
Sat Dec 16 15:12:27 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: a1fe596cffd46c3786a30d3a39b4cf69e0ecc6c7
      https://github.com/wesnoth/wesnoth/commit/a1fe596cffd46c3786a30d3a39b4cf69e0ecc6c7
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2017-12-16 (Sat, 16 Dec 2017)

  Changed paths:
    M src/map/label.cpp
    M src/map/label.hpp

  Log Message:
  -----------
  Fix #2273: map labels aren't drawn in the editor

It was caused by two independent bugs. Fixing either would have made the
map labels to show up: I fixed both.

First, map_labels::visible_global_label() is intended to check whether any
label from the player's team is shown in a certain position, in order to
check if a global label in the same position can be shown. In the editor,
the "team name" is the empty string - the same as the "team name" for
global labels. As a result, all global labels were considered to be in the
player's team, and therefore every global label was suppressed in favor of
itself.

That wouldn't have been a problem on its own, however. Commit 2fb13f89daa25c8443e537a3cbafb43bb4301b4f
added a check that makes all labels visible in the editor, before checking
if they overlap team labels. The problem was that the check wasn't working.
It's true that there are no teams in the map editor, but the same isn't
true in the scenario editor - and labels can only be placed in the scenario
editor.

I fixed the first problem by checking if there is a viewing team to begin
with, and the second problem by calling display::in_editor() instead of
checking the number of teams.





More information about the Commits mailing list