Explorar o código

client: do not show obstacles placed by another player

Konstantin %!s(int64=2) %!d(string=hai) anos
pai
achega
1b893fa525
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      client/battle/BattleObstacleController.cpp

+ 5 - 0
client/battle/BattleObstacleController.cpp

@@ -78,6 +78,11 @@ void BattleObstacleController::obstaclePlaced(const std::vector<std::shared_ptr<
 {
 	for (auto const & oi : obstacles)
 	{
+		auto side = owner.curInt->cb->playerToSide(owner.curInt->playerID);
+
+		if(!oi->visibleForSide(side.get(),owner.curInt->cb->battleHasNativeStack(side.get())))
+			continue;
+
 		auto spellObstacle = dynamic_cast<const SpellCreatedObstacle*>(oi.get());
 
 		if (!spellObstacle)