From 592e1fff6e527990cb8dde01f6b44e70ef2f5529 Mon Sep 17 00:00:00 2001 From: "J. Tyne" Date: Tue, 21 Aug 2012 22:52:17 +0000 Subject: [PATCH] Simplify a conditional. --- src/map.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 61a65782e6f..05fb193a798 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -560,12 +560,9 @@ bool gamemap::on_board(const map_location& loc) const bool gamemap::on_board_with_border(const map_location& loc) const { - if(tiles_.empty()) { - return false; - } else { - return loc.x >= (0 - border_size_) && loc.x < (w_ + border_size_) && - loc.y >= (0 - border_size_) && loc.y < (h_ + border_size_); - } + return !tiles_.empty() && + loc.x >= -border_size_ && loc.x < w_ + border_size_ && + loc.y >= -border_size_ && loc.y < h_ + border_size_; } const terrain_type& gamemap::get_terrain_info(const t_translation::t_terrain terrain) const