From d7a65ed18ee3439a6e16d42a13e4203081b6be5a Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sun, 30 Jan 2011 23:01:55 +0000 Subject: [PATCH] fix for updateAttackStopped and command queuing; switching tilesets react with delay like switching maps; new/updated maps; reverted egypt mining slave model; many loading screens for scenarios --- source/glest_game/facilities/game_util.cpp | 2 +- .../glest_game/menu/menu_state_custom_game.cpp | 16 +++++++++------- source/glest_game/menu/menu_state_custom_game.h | 2 +- source/glest_game/world/unit_updater.cpp | 6 ++++++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index 2551e849..bd6dbb2f 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -27,7 +27,7 @@ using namespace Shared::Platform; namespace Glest { namespace Game { const string mailString = "contact@megaglest.org"; -const string glestVersionString = "v3.4.0-beta3"; +const string glestVersionString = "v3.4.0-dev"; #if defined(SVNVERSION) const string SVN_Rev = string("Rev: ") + string(SVNVERSION); #elif defined(SVNVERSIONHEADER) diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 68074983..a69194f7 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -61,7 +61,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b currentFactionName_factionPreview=""; mapPreviewTexture=NULL; hasCheckedForUPNP = false; - needToPublishMap=false; + needToPublishDelayed=false; mapPublishingDelayTimer=time(NULL); publishToMasterserverThread = NULL; @@ -666,7 +666,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ if(hasNetworkGameSettings() == true) { //delay publishing for 5 seconds - needToPublishMap=true; + needToPublishDelayed=true; mapPublishingDelayTimer=time(NULL); } } @@ -734,8 +734,10 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ } if(hasNetworkGameSettings() == true) { - needToSetChangedGameSettings = true; - lastSetChangedGameSettings = time(NULL); + + //delay publishing for 5 seconds + needToPublishDelayed=true; + mapPublishingDelayTimer=time(NULL); } } else if(listBoxMapFilter.mouseClick(x, y)){ @@ -1707,17 +1709,17 @@ void MenuStateCustomGame::update() { // give it to me baby, aha aha ... publishToMasterserver(); } - if(needToPublishMap){ + if(needToPublishDelayed){ // this delay is done to make it possible to switch over maps which are not meant to be distributed if(difftime(time(NULL), mapPublishingDelayTimer) >= 5){ // after 5 seconds we are allowed to publish again! needToSetChangedGameSettings = true; lastSetChangedGameSettings = time(NULL); // set to normal.... - needToPublishMap=false; + needToPublishDelayed=false; } } - if(!needToPublishMap){ + if(!needToPublishDelayed){ bool broadCastSettings = (difftime(time(NULL),lastSetChangedGameSettings) >= 2); if(broadCastSettings == true) { diff --git a/source/glest_game/menu/menu_state_custom_game.h b/source/glest_game/menu/menu_state_custom_game.h index 8a49b9bd..da541e39 100644 --- a/source/glest_game/menu/menu_state_custom_game.h +++ b/source/glest_game/menu/menu_state_custom_game.h @@ -98,7 +98,7 @@ private: time_t lastMasterserverPublishing; time_t lastNetworkPing; time_t mapPublishingDelayTimer; - bool needToPublishMap; + bool needToPublishDelayed; bool needToRepublishToMasterserver; bool needToBroadcastServerSettings; diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 4858c713..ae815162 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -428,6 +428,12 @@ void UnitUpdater::updateAttackStopped(Unit *unit) { const AttackStoppedCommandType *asct= static_cast(command->getCommandType()); Unit *enemy; + if(unit->getCommandSize()>1) + { + unit->finishCommand(); // attackStopped is skipped if somthing else is queued after this. + return; + } + if(attackableOnRange(unit, &enemy, asct->getAttackSkillType())){ unit->setCurrSkill(asct->getAttackSkillType()); unit->setTarget(enemy);