Skip to content

Commit

Permalink
refactor synced_commands [move] to use read_locations, not reimpl.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed May 17, 2014
1 parent b242735 commit 39f2b66
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/synced_commands.cpp
Expand Up @@ -250,17 +250,13 @@ SYNCED_COMMAND_HANDLER_FUNCTION(move, child, use_undo, show, error_handler)
return false;
}

std::vector<map_location> steps;// = parse_location_range(x,y);

for (unsigned i = 0; i < xvals.size(); ++i) {
try {
int xi = lexical_cast<int> (xvals[i]);
int yi = lexical_cast<int> (yvals[i]);
steps.push_back(map_location(xi-1, yi-1));
} catch (bad_lexical_cast &) {
WRN_REPLAY << "Warning: Path data contained something which could not be parsed to an integer:" << "\n x = " << x << "\n y = " << y << std::endl;
return false;
}
std::vector<map_location> steps;

try {
read_locations(child,steps);
} catch (bad_lexical_cast &) {
WRN_REPLAY << "Warning: Path data contained something which could not be parsed to an integer:" << "\n x = " << x << "\n y = " << y << std::endl;
return false;
}

if(steps.empty())
Expand Down

0 comments on commit 39f2b66

Please sign in to comment.