瀏覽代碼

Fix activation of world view on end turn in multiplayer

Ivan Savenko 1 年之前
父節點
當前提交
dde5cea601

+ 1 - 1
client/adventureMap/AdventureMapInterface.cpp

@@ -374,7 +374,7 @@ void AdventureMapInterface::onEnemyTurnStarted(PlayerColor playerID, bool isHuma
 	mapAudio->onEnemyTurnStarted();
 	widget->getMinimap()->setAIRadar(!isHuman);
 	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)

+ 6 - 7
client/adventureMap/AdventureMapShortcuts.cpp

@@ -518,7 +518,7 @@ bool AdventureMapShortcuts::optionCanVisitObject()
 	auto * hero = LOCPLINT->localState->getCurrentHero();
 	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
 }
 
@@ -553,26 +553,25 @@ bool AdventureMapShortcuts::optionSpellcasting()
 
 bool AdventureMapShortcuts::optionInMapView()
 {
-	return state == EAdventureState::MAKING_TURN || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN;
+	return state == EAdventureState::MAKING_TURN;
 }
 
 bool AdventureMapShortcuts::optionInWorldView()
 {
-	return state == EAdventureState::WORLD_VIEW || state == EAdventureState::OTHER_HUMAN_PLAYER_TURN;
+	return state == EAdventureState::WORLD_VIEW;
 }
 
 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()
 {
-	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()
 {
-	return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL
-		|| state == EAdventureState::OTHER_HUMAN_PLAYER_TURN;
+	return state == EAdventureState::MAKING_TURN || state == EAdventureState::WORLD_VIEW || state == EAdventureState::CASTING_SPELL;
 }

+ 0 - 1
client/adventureMap/AdventureState.h

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