|
@@ -47,6 +47,7 @@
|
|
#include "../lib/serializer/CTypeList.h"
|
|
#include "../lib/serializer/CTypeList.h"
|
|
#include "../lib/serializer/Connection.h"
|
|
#include "../lib/serializer/Connection.h"
|
|
#include "../lib/serializer/Cast.h"
|
|
#include "../lib/serializer/Cast.h"
|
|
|
|
+#include "../lib/serializer/JsonSerializer.h"
|
|
|
|
|
|
#ifndef _MSC_VER
|
|
#ifndef _MSC_VER
|
|
#include <boost/thread/xtime.hpp>
|
|
#include <boost/thread/xtime.hpp>
|
|
@@ -4857,7 +4858,28 @@ bool CGameHandler::handleDamageFromObstacle(const CStack * curStack, bool stackI
|
|
battleCast.applyEffects(spellEnv, true);
|
|
battleCast.applyEffects(spellEnv, true);
|
|
|
|
|
|
if(oneTimeObstacle)
|
|
if(oneTimeObstacle)
|
|
|
|
+ {
|
|
removeObstacle(*obstacle);
|
|
removeObstacle(*obstacle);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ // For the hidden spell created obstacles, e.g. QuickSand, it should be revealed after taking damage
|
|
|
|
+ ObstacleChanges changeInfo;
|
|
|
|
+ changeInfo.id = spellObstacle->uniqueID;
|
|
|
|
+ changeInfo.operation = ObstacleChanges::EOperation::UPDATE;
|
|
|
|
+
|
|
|
|
+ SpellCreatedObstacle changedObstacle;
|
|
|
|
+ changedObstacle.uniqueID = spellObstacle->uniqueID;
|
|
|
|
+ changedObstacle.revealed = true;
|
|
|
|
+
|
|
|
|
+ changeInfo.data.clear();
|
|
|
|
+ JsonSerializer ser(nullptr, changeInfo.data);
|
|
|
|
+ ser.serializeStruct("obstacle", changedObstacle);
|
|
|
|
+
|
|
|
|
+ BattleObstaclesChanged bocp;
|
|
|
|
+ bocp.changes.emplace_back(changeInfo);
|
|
|
|
+ sendAndApply(&bocp);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|