- disabled jps for now and fixed ai multiplier for headless mode

This commit is contained in:
Mark Vejvoda 2011-09-27 01:11:11 +00:00
parent d3eda7d0f2
commit fdd04d10c1
3 changed files with 32 additions and 2 deletions

View File

@ -965,7 +965,7 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
if(nodeLimitReached == false) {
//printf("\n\n\n====== START AStar-JPS Pathfinder start [%s] end [%s]\n",unitPos.getString().c_str(),finalPos.getString().c_str());
const bool tryJPSPathfinder = true;
const bool tryJPSPathfinder = false;
while(nodeLimitReached == false) {
whileLoopCount++;

View File

@ -938,6 +938,35 @@ void MenuStateConnectedGame::broadCastGameSettingsToMasterserver() {
}
void MenuStateConnectedGame::updateResourceMultiplier(const int index) {
ControlType ct= static_cast<ControlType>(listBoxControls[index].getSelectedItemIndex());
if(ct == ctHuman || ct == ctNetwork || ct == ctClosed) {
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::normalMultiplier-0.5f)*10);
listBoxRMultiplier[index].setEnabled(false);
}
else if(ct == ctCpuEasy || ct == ctNetworkCpuEasy)
{
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::easyMultiplier-0.5f)*10);
listBoxRMultiplier[index].setEnabled(true);
}
else if(ct == ctCpu || ct == ctNetworkCpu) {
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::normalMultiplier-0.5f)*10);
listBoxRMultiplier[index].setEnabled(true);
}
else if(ct == ctCpuUltra || ct == ctNetworkCpuUltra)
{
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::ultraMultiplier-0.5f)*10);
listBoxRMultiplier[index].setEnabled(true);
}
else if(ct == ctCpuMega || ct == ctNetworkCpuMega)
{
listBoxRMultiplier[index].setSelectedItemIndex((GameConstants::megaMultiplier-0.5f)*10);
listBoxRMultiplier[index].setEnabled(true);
}
listBoxRMultiplier[index].setEditable(listBoxRMultiplier[index].getEnabled());
listBoxRMultiplier[index].setVisible(listBoxRMultiplier[index].getEnabled());
}
void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButton) {
try {
@ -1209,7 +1238,7 @@ void MenuStateConnectedGame::mouseClickAdmin(int x, int y, MouseButton mouseButt
// needToSetChangedGameSettings = true;
// lastSetChangedGameSettings = time(NULL);
// }
// updateResourceMultiplier(i);
updateResourceMultiplier(i);
broadCastGameSettingsToMasterserver();
}

View File

@ -222,6 +222,7 @@ private:
void PlayNow(bool saveGame);
bool isMasterserverAdmin();
void broadCastGameSettingsToMasterserver();
void updateResourceMultiplier(const int index);
};
}}//end namespace