mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
vcmi: expert dispel now works mechanically correct
This commit is contained in:
@ -47,10 +47,7 @@ std::vector<std::shared_ptr<const CObstacleInstance>> CBattleInfoEssentials::bat
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!!player && *perspective != battleGetMySide())
|
if(!!player && *perspective != battleGetMySide())
|
||||||
{
|
logGlobal->warn("Unauthorized obstacles access attempt, assuming massive spell");
|
||||||
logGlobal->error("Unauthorized obstacles access attempt!");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(const auto & obstacle : getBattle()->getAllObstacles())
|
for(const auto & obstacle : getBattle()->getAllObstacles())
|
||||||
|
@ -273,12 +273,7 @@ void Obstacle::placeObstacles(ServerCallback * server, const Mechanics * m, cons
|
|||||||
|
|
||||||
BattleObstaclesChanged pack;
|
BattleObstaclesChanged pack;
|
||||||
|
|
||||||
boost::optional<BattlePerspective::BattlePerspective> perspective;
|
auto all = m->battle()->battleGetAllObstacles(BattlePerspective::ALL_KNOWING);
|
||||||
|
|
||||||
if(!m->battle()->getPlayerID())
|
|
||||||
perspective = boost::make_optional(BattlePerspective::ALL_KNOWING);
|
|
||||||
|
|
||||||
auto all = m->battle()->battleGetAllObstacles(perspective);
|
|
||||||
|
|
||||||
int obstacleIdToGive = 1;
|
int obstacleIdToGive = 1;
|
||||||
for(auto & one : all)
|
for(auto & one : all)
|
||||||
|
@ -89,7 +89,7 @@ std::set<const CObstacleInstance *> RemoveObstacle::getTargets(const Mechanics *
|
|||||||
std::set<const CObstacleInstance *> possibleTargets;
|
std::set<const CObstacleInstance *> possibleTargets;
|
||||||
if(m->isMassive() || alwaysMassive)
|
if(m->isMassive() || alwaysMassive)
|
||||||
{
|
{
|
||||||
for(const auto & obstacle : m->battle()->battleGetAllObstacles())
|
for(const auto & obstacle : m->battle()->battleGetAllObstacles(BattlePerspective::ALL_KNOWING))
|
||||||
if(canRemove(obstacle.get()))
|
if(canRemove(obstacle.get()))
|
||||||
possibleTargets.insert(obstacle.get());
|
possibleTargets.insert(obstacle.get());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user