mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer - drop implicit int conversion for BattleHex class and implement toInt() instead - implement necessary operators in BattleHex - adjust code to work properly with JSON serializer
This commit is contained in:
@@ -98,7 +98,7 @@ bool LuaSpellEffect::applicable(Problem & problem, const Mechanics * m, const Ef
|
||||
for(const auto & dest : target)
|
||||
{
|
||||
JsonNode targetData;
|
||||
targetData.Vector().emplace_back(static_cast<si16>(dest.hexValue));
|
||||
targetData.Vector().emplace_back(dest.hexValue.toInt());
|
||||
|
||||
if(dest.unitValue)
|
||||
targetData.Vector().emplace_back(dest.unitValue->unitId());
|
||||
@@ -141,7 +141,7 @@ void LuaSpellEffect::apply(ServerCallback * server, const Mechanics * m, const E
|
||||
for(const auto & dest : target)
|
||||
{
|
||||
JsonNode targetData;
|
||||
targetData.Vector().emplace_back(static_cast<si16>(dest.hexValue));
|
||||
targetData.Vector().emplace_back(dest.hexValue.toInt());
|
||||
|
||||
if(dest.unitValue)
|
||||
targetData.Vector().emplace_back(dest.unitValue->unitId());
|
||||
|
||||
Reference in New Issue
Block a user