diff --git a/data/glest_game b/data/glest_game index b1c0f0cc1..19119ebb9 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit b1c0f0cc18cdd2311b581b44e7ae161317438c93 +Subproject commit 19119ebb9c7c91d364c8d413194e476aa815000b diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index 4894c8f83..e56a9106a 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -1224,7 +1224,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if(ai->outputAIBehaviourToConsole()) printf("produceSpecific aiInterface->reqsOk(ct) = [%d] Testing AI RULE Name[%s]\n",aiInterface->reqsOk(ct), this->getName().c_str()); if(aiInterface->reqsOk(ct)){ - defCt= ct; + //defCt= ct; producers.push_back(i); producersDefaultCommandType[i].push_back(ct); } @@ -1779,7 +1779,7 @@ void AiRuleBuild::buildSpecific(const BuildTask *bt) { if(aiInterface->reqsOk(bct)) { builders.push_back(i); buildersDefaultCommandType[i].push_back(bct); - defBct= bct; + //defBct= bct; } } } diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index 20cb2f518..7618bd19b 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -876,7 +876,10 @@ void GraphicScrollBar::setVisibleStart(int vs){ if(visibleStart<0) { visibleStart=0; } - float partSize=(float)getLength()/(float)elementCount; + float partSize = 0.f; + if(elementCount > 0) { + partSize = (float)getLength()/(float)elementCount; + } visibleCompPosStart=visibleStart*partSize; visibleCompPosEnd=visibleStart*partSize+visibleSize*partSize; if(visibleCompPosEnd>getLength()) { diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 5f8e595bf..d1b926112 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -316,6 +316,11 @@ Game::Game(Program *program, const GameSettings *gameSettings,bool masterserverM this->masterserverMode = masterserverMode; videoPlayer = NULL; playingStaticVideo = false; + highlightCellTexture = NULL; + playerIndexDisconnect=0; + updateFpsAvgTest=0; + renderFpsAvgTest=0; + cameraDragAllowed=false; if(this->masterserverMode == true) { printf("Starting a new game...\n"); diff --git a/source/glest_game/gui/display.cpp b/source/glest_game/gui/display.cpp index 8ed4a3440..e66fdf74c 100644 --- a/source/glest_game/gui/display.cpp +++ b/source/glest_game/gui/display.cpp @@ -49,7 +49,7 @@ void Display::calculateUpDimensions(int index) { maxUpIndex=index; if(maxUpIndex+1>upCellSideCount*upCellSideCount){ upCellSideCount=upCellSideCount+1; - upImageSize=imageSize*cellSideCount/upCellSideCount+0.9f; + upImageSize = static_cast(imageSize) * static_cast(cellSideCount) / static_cast(upCellSideCount) + 0.9f; } } } diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 9ae5e5dcc..6fbcf5800 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1595,7 +1595,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ } if(canGrabSlot == true) { - if(i < mapInfo.players && grabSlotButton[i].mouseClick(x, y)) { + if(clientInterface != NULL && i < mapInfo.players && grabSlotButton[i].mouseClick(x, y)) { //printf("Send slot switch request for slot = %d, myCurrentIndex = %d\n",i,myCurrentIndex); soundRenderer.playFx(coreData.getClickSoundB()); diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 0927c9cab..e92d30103 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -681,7 +681,7 @@ Model *SkillType::getAnimation(float animProgress, const Unit *unit, for(unsigned int i = 0; i < animationAttributes.size(); ++i) { const AnimationAttributes &attributes = animationAttributes[i]; if(attributes.fromHp == 0 && attributes.toHp == 0) { - modelIndex = i; + //modelIndex = i; foundSpecificAnimation = true; filteredAnimations.push_back(i); //printf("SELECTING Model index = %d [%s] model attributes [%d to %d] for unit [%s - %d] with HP = %d\n",i,animations[modelIndex]->getFileName().c_str(),attributes.fromHp,attributes.toHp,unit->getType()->getName().c_str(),unit->getId(),unit->getHp()); diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 4c276bfbc..95dc8bf6e 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -477,7 +477,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) { objNumber = ::Shared::PlatformByteOrder::fromCommonEndian(objNumber); SurfaceCell *sc= getSurfaceCell(toSurfCoords(Vec2i(i, j))); - if(objNumber == 0) { + if(objNumber <= 0) { sc->setObject(NULL); } else if(objNumber <= Tileset::objCount) { diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c index 80585525b..0074b7bdf 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c @@ -164,7 +164,7 @@ int ftpStat(const char* path, ftpPathInfo_S *info) pw = getpwuid(fileInfo.st_uid); if(pw) - strncpy(info->user, pw->pw_name, sizeof(info->user)); + strncpy(info->user, pw->pw_name, sizeof(info->user)-1); else snprintf(info->user, 20,"%04d", fileInfo.st_uid);