mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Use upper_bound instead of sort since predicate does not fulfills strict weak ordering requirement for std::sort
This commit is contained in:
@ -54,9 +54,8 @@ void MapRendererContextState::addObject(const CGObjectInstance * obj)
|
||||
if(LOCPLINT->cb->isInTheMap(currTile) && obj->coveringAt(currTile))
|
||||
{
|
||||
auto & container = objects[currTile.z][currTile.x][currTile.y];
|
||||
|
||||
container.push_back(obj->id);
|
||||
boost::range::sort(container, compareObjectBlitOrder);
|
||||
auto position = std::upper_bound(container.begin(), container.end(), obj->id, compareObjectBlitOrder);
|
||||
container.insert(position, obj->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user