1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Merge pull request #168 from vmarkovtsev/issue/1799

Fix 1799 not updated hero info box on artifact pickup
This commit is contained in:
Alexander Shishkin
2016-01-23 01:52:41 +03:00

View File

@@ -119,7 +119,7 @@ CPlayerInterface::CPlayerInterface(PlayerColor Player)
isAutoFightOn = false; isAutoFightOn = false;
duringMovement = false; duringMovement = false;
ignoreEvents = false; ignoreEvents = false;
} }
CPlayerInterface::~CPlayerInterface() CPlayerInterface::~CPlayerInterface()
@@ -824,16 +824,16 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
//tidy up //tidy up
BattleAction ret = *(b->givenCommand->data); BattleAction ret = *(b->givenCommand->data);
vstd::clear_pointer(b->givenCommand->data); vstd::clear_pointer(b->givenCommand->data);
if(ret.actionType == Battle::CANCEL) if(ret.actionType == Battle::CANCEL)
{ {
if(stackId != ret.stackNumber) if(stackId != ret.stackNumber)
logGlobal->error("Not current active stack action canceled"); logGlobal->error("Not current active stack action canceled");
logGlobal->traceStream() << "Canceled command for " << stackName; logGlobal->traceStream() << "Canceled command for " << stackName;
} }
else else
logGlobal->traceStream() << "Giving command for " << stackName; logGlobal->traceStream() << "Giving command for " << stackName;
return ret; return ret;
} }
@@ -1610,11 +1610,11 @@ void CPlayerInterface::update()
{ {
// Make sure that gamestate won't change when GUI objects may obtain its parts on event processing or drawing request // Make sure that gamestate won't change when GUI objects may obtain its parts on event processing or drawing request
boost::shared_lock<boost::shared_mutex> gsLock(cb->getGsMutex()); boost::shared_lock<boost::shared_mutex> gsLock(cb->getGsMutex());
// While mutexes were locked away we may be have stopped being the active interface // While mutexes were locked away we may be have stopped being the active interface
if(LOCPLINT != this) if(LOCPLINT != this)
return; return;
//if there are any waiting dialogs, show them //if there are any waiting dialogs, show them
if((howManyPeople <= 1 || makingTurn) && !dialogs.empty() && !showingDialog->get()) if((howManyPeople <= 1 || makingTurn) && !dialogs.empty() && !showingDialog->get())
{ {
@@ -2195,7 +2195,7 @@ void CPlayerInterface::advmapSpellCast(const CGHeroInstance * caster, int spellI
int level = caster->getSpellSchoolLevel(spell); int level = caster->getSpellSchoolLevel(spell);
adventureInt->worldViewOptions.showAllTerrain = (level>2); adventureInt->worldViewOptions.showAllTerrain = (level>2);
} }
auto castSoundPath = spell->getCastSound(); auto castSoundPath = spell->getCastSound();
if (!castSoundPath.empty()) if (!castSoundPath.empty())
CCS->soundh->playSound(castSoundPath); CCS->soundh->playSound(castSoundPath);
@@ -2513,6 +2513,7 @@ void CPlayerInterface::stacksRebalanced(const StackLocation &src, const StackLoc
void CPlayerInterface::artifactPut(const ArtifactLocation &al) void CPlayerInterface::artifactPut(const ArtifactLocation &al)
{ {
EVENT_HANDLER_CALLED_BY_CLIENT; EVENT_HANDLER_CALLED_BY_CLIENT;
adventureInt->infoBar.showSelection();
} }
void CPlayerInterface::artifactRemoved(const ArtifactLocation &al) void CPlayerInterface::artifactRemoved(const ArtifactLocation &al)
@@ -2783,8 +2784,8 @@ void CPlayerInterface::showWorldViewEx(const std::vector<ObjectPosInfo>& objectP
{ {
EVENT_HANDLER_CALLED_BY_CLIENT; EVENT_HANDLER_CALLED_BY_CLIENT;
//TODO: showWorldViewEx //TODO: showWorldViewEx
std::copy(objectPositions.begin(), objectPositions.end(), std::back_inserter(adventureInt->worldViewOptions.iconPositions)); std::copy(objectPositions.begin(), objectPositions.end(), std::back_inserter(adventureInt->worldViewOptions.iconPositions));
viewWorldMap(); viewWorldMap();
} }