Skip to content

Commit

Permalink
fix bug #22251 (map labels not appearing in mp)
Browse files Browse the repository at this point in the history
This fixes a bug introduced in this commit:
90501cf

If the variable "res" is redeclared inside the else clause, the
desired return value goes out of scope before the function ends,
and we always return NULL instead.

This commit makes the line assign the variable without redeclaring
it.
  • Loading branch information
cbeck88 committed Oct 8, 2014
1 parent ddbdec3 commit dc861ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/map_label.cpp
Expand Up @@ -183,7 +183,7 @@ const terrain_label* map_labels::set_label(const map_location& loc,
terrain_label* global_label = get_label_private(loc, "");

// Add the new label.
terrain_label* res = new terrain_label(text,
res = new terrain_label(text,
team_name,
loc,
*this,
Expand Down

0 comments on commit dc861ea

Please sign in to comment.