mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-12 05:09:18 +00:00
Have on_board_with_border() detect a newly initialized tiles_ as empty.
(It gets initialized to a size 1 vector for some reason.)
This commit is contained in:
parent
352c9a5bc9
commit
b12e67291f
@ -588,7 +588,7 @@ bool gamemap::on_board(const map_location& loc) const
|
|||||||
|
|
||||||
bool gamemap::on_board_with_border(const map_location& loc) const
|
bool gamemap::on_board_with_border(const map_location& loc) const
|
||||||
{
|
{
|
||||||
return !tiles_.empty() &&
|
return !(tiles_.empty() || tiles_[0].empty()) && // tiles_ is not empty when initialized.
|
||||||
loc.x >= -border_size_ && loc.x < w_ + border_size_ &&
|
loc.x >= -border_size_ && loc.x < w_ + border_size_ &&
|
||||||
loc.y >= -border_size_ && loc.y < h_ + border_size_;
|
loc.y >= -border_size_ && loc.y < h_ + border_size_;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user