1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Fix activation of world view on end turn in multiplayer

This commit is contained in:
Ivan Savenko 2024-08-04 13:19:12 +00:00
parent e8c3252214
commit dde5cea601
3 changed files with 7 additions and 9 deletions

View File

@ -374,7 +374,7 @@ void AdventureMapInterface::onEnemyTurnStarted(PlayerColor playerID, bool isHuma
mapAudio->onEnemyTurnStarted(); mapAudio->onEnemyTurnStarted();
widget->getMinimap()->setAIRadar(!isHuman); widget->getMinimap()->setAIRadar(!isHuman);
widget->getInfoBar()->startEnemyTurn(playerID); widget->getInfoBar()->startEnemyTurn(playerID);
setState(isHuman ? EAdventureState::OTHER_HUMAN_PLAYER_TURN : EAdventureState::AI_PLAYER_TURN); setState(isHuman ? EAdventureState::MAKING_TURN : EAdventureState::AI_PLAYER_TURN);
} }
void AdventureMapInterface::setState(EAdventureState state) void AdventureMapInterface::setState(EAdventureState state)

View File

@ -518,7 +518,7 @@ bool AdventureMapShortcuts::optionCanVisitObject()
auto * hero = LOCPLINT->localState->getCurrentHero(); auto * hero = LOCPLINT->localState->getCurrentHero();
auto objects = LOCPLINT->cb->getVisitableObjs(hero->visitablePos()); auto objects = LOCPLINT->cb->getVisitableObjs(hero->visitablePos());
assert(vstd::contains(objects,hero)); //assert(vstd::contains(objects,hero));
return objects.size() > 1; // there is object other than our hero return objects.size() > 1; // there is object other than our hero
} }
@ -553,26 +553,25 @@ bool AdventureMapShortcuts::optionSpellcasting()
bool AdventureMapShortcuts::optionInMapView() bool AdventureMapShortcuts::optionInMapView()
{ {
return state == EAdventureState::MAKING_TURN || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN; return state == EAdventureState::MAKING_TURN;
} }
bool AdventureMapShortcuts::optionInWorldView() bool AdventureMapShortcuts::optionInWorldView()
{ {
return state == EAdventureState::WORLD_VIEW || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN; return state == EAdventureState::WORLD_VIEW;
} }
bool AdventureMapShortcuts::optionSidePanelActive() bool AdventureMapShortcuts::optionSidePanelActive()
{ {
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN; return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW;
} }
bool AdventureMapShortcuts::optionMapScrollingActive() bool AdventureMapShortcuts::optionMapScrollingActive()
{ {
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN; return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW;
} }
bool AdventureMapShortcuts::optionMapViewActive() bool AdventureMapShortcuts::optionMapViewActive()
{ {
return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL;
|| state == EAdventureState::OTHER_HUMAN_PLAYER_TURN;
} }

View File

@ -15,7 +15,6 @@ enum class EAdventureState
HOTSEAT_WAIT, HOTSEAT_WAIT,
MAKING_TURN, MAKING_TURN,
AI_PLAYER_TURN, AI_PLAYER_TURN,
OTHER_HUMAN_PLAYER_TURN,
CASTING_SPELL, CASTING_SPELL,
WORLD_VIEW WORLD_VIEW
}; };