From 529394a4e7622a4adf15835716e96e5eb612c681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Fri, 7 Sep 2012 22:43:41 +0000 Subject: [PATCH] Development build 0.89b * Updated changelog * Some logging I did for #1066 --- ChangeLog | 24 ++++++++++++++++++++++++ client/CPlayerInterface.cpp | 13 ++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bd2b1d2bf..763b41111 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +0.89 -> 0.next +GENERAL: +* New filesystem allowing easier resource adding/replacing +* Moved many hard-coded settings into text config files +* Commander level-up dialog +* New Quest Log window + +BATTLES +* New graphics for Stack Queue +* Death Stare works identically to H3 +* No explosion when catapult fails to damage the wall +* Fixed crash when attacking stack dies before counterattack +* Fixed Orb of Inhibition and Recanter's Cloak (they were incorrectly implemented) +* Fleeing hero won't lose artifacts. +* Spellbook won't be captured. + + +ADVENTURE AI +* support for quests (Seer Huts, Quest Guardians, and so) +* AI will now wander with all the heroes that have spare movement points. It should prevent stalling. +* AI will now understand threat of Abandoned Mine. +* AI can now exchange armies between heroes. By default, it will pass army to main hero. +* Fixed strange case when AI found allied town extremely dangerous + 0.88 -> 0.89 (Jun 01 2012) GENERAL * Mostly implemented Commanders feature (missing level-up dialog) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 0e9b9bf02..7d51a5398 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1177,11 +1177,17 @@ void CPlayerInterface::serialize( CISer &h, const int version ) bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) { + tlog5 << __FUNCTION__ << std::endl; if(!LOCPLINT->makingTurn) return false; if (!h) return false; //can't find hero + //It shouldn't be possible to move hero with open dialog (or dialog waiting in bg) + if(showingDialog->get() || dialogs.size()) + return false; + + if (adventureInt && adventureInt->isHeroSleeping(h)) { adventureInt->sleepWake.clickLeft(true, false); @@ -1196,9 +1202,12 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) { //evil... + tlog5 << "before [un]locks in " << __FUNCTION__ << std::endl; auto unlockEvents = vstd::makeUnlockGuard(eventsM); auto unlockGs = vstd::makeUnlockSharedGuard(cb->getGsMutex()); //GS mutex is above PIM because CClient::run thread first locks PIM and then GS -> so this way we avoid deadlocks auto unlockPim = vstd::makeUnlockGuard(*pim); + tlog5 << "after [un]locks in " << __FUNCTION__ << std::endl; + //TODO the above combination works... but it should all be atomic (unlock all three or none) { path.convert(0); @@ -1246,11 +1255,13 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) int3 endpos(path.nodes[i-1].coord.x, path.nodes[i-1].coord.y, h->pos.z); bool guarded = CGI->mh->map->isInTheMap(cb->guardingCreaturePosition(endpos - int3(1, 0, 0))); + tlog5 << "Requesting hero movement to " << endpos << std::endl; cb->moveHero(h,endpos); while(stillMoveHero.data != STOP_MOVE && stillMoveHero.data != CONTINUE_MOVE) stillMoveHero.cond.wait(un); + tlog5 << "Resuming " << __FUNCTION__ << std::endl; if (guarded) // Abort movement if a guard was fought. break; } @@ -1336,7 +1347,7 @@ void CPlayerInterface::showArtifactAssemblyDialog (ui32 artifactID, ui32 assembl void CPlayerInterface::requestRealized( PackageApplied *pa ) { EVENT_HANDLER_CALLED_BY_CLIENT; - if(stillMoveHero.get() == DURING_MOVE) + if(pa->packType == typeList.getTypeID() && stillMoveHero.get() == DURING_MOVE) stillMoveHero.setn(CONTINUE_MOVE); }