Skip to content

Commit

Permalink
Merge pull request #1874 from LGM-Doyle/fix_clamp_universe_object_mov…
Browse files Browse the repository at this point in the history
…es_to_universe_dims

Change UniverseObject::MoveTo() invalid position warning to a clamp.
  • Loading branch information
LGM-Doyle committed Nov 30, 2017
2 parents 11894ec + ca02766 commit c1b449b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions universe/UniverseObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <stdexcept>
#include <boost/lexical_cast.hpp>


// static(s)
const int INVALID_OBJECT_ID = -1;
const int TEMPORARY_OBJECT_ID = -2;
Expand Down Expand Up @@ -317,13 +316,6 @@ void UniverseObject::MoveTo(std::shared_ptr<UniverseObject> object) {
}

void UniverseObject::MoveTo(double x, double y) {
if ((x < 0.0 || GetUniverse().UniverseWidth() < x || y < 0.0 || GetUniverse().UniverseWidth() < y)
&& (x != INVALID_POSITION || y != INVALID_POSITION))
{
DebugLogger() << "UniverseObject::MoveTo : Placing object \"" << m_name << "\" ("
<< m_id << ") outside the map area at (" << x << ", " << y << ").";
}

if (m_x == x && m_y == y)
return;

Expand Down

0 comments on commit c1b449b

Please sign in to comment.