- trying to bugfix crashes with grouped commands

This commit is contained in:
Mark Vejvoda 2011-09-23 18:54:35 +00:00
parent 72c12a3459
commit 42bbbd2e42
2 changed files with 4 additions and 5 deletions

View File

@ -30,7 +30,7 @@ using Shared::Util::RandomGen;
namespace Glest { namespace Game {
bool CommandGroupUnitSorter::compare(const Unit *l, const Unit *r) {
bool CommandGroupUnitSorter::operator()(const Unit *l, const Unit *r) {
if(!l) {
printf("Error l == NULL\n");
}
@ -127,7 +127,7 @@ bool CommandGroupUnitSorter::compare(const Unit *l, const Unit *r) {
}
void Faction::sortUnitsByCommandGroups() {
std::sort(units.begin(),units.end(),CommandGroupUnitSorter::compare);
std::sort(units.begin(),units.end(),CommandGroupUnitSorter());
}
// =====================================================

View File

@ -49,9 +49,8 @@ class Faction;
/// Each of the game players
// =====================================================
class CommandGroupUnitSorter {
public:
static bool compare(const Unit *l, const Unit *r);
struct CommandGroupUnitSorter {
bool operator()(const Unit *l, const Unit *r);
};
class FactionThread : public BaseThread {