1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fix build

This commit is contained in:
Ivan Savenko
2023-08-20 20:09:32 +03:00
parent e2718db791
commit b61c9a9e35
6 changed files with 32 additions and 42 deletions

View File

@@ -183,7 +183,7 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
// close window from another player
if(auto w = GH.windows().topWindow<CInfoWindow>())
if(w->ID == -1 && player != playerID)
if(w->ID == QueryID::NONE && player != playerID)
w->close();
// remove all dialogs that do not expect query answer

View File

@@ -101,62 +101,53 @@ std::string CBonusTypeHandler::bonusToGraphics(const std::shared_ptr<Bonus> & bo
}
case BonusType::SPELL_DAMAGE_REDUCTION: //Spell damage reduction for all schools
{
switch(bonus->subtype)
{
case SpellSchool(ESpellSchool::ANY):
if (bonus->subtype == SpellSchool::ANY.getNum())
fileName = "E_GOLEM.bmp";
break;
case SpellSchool(ESpellSchool::AIR):
if (bonus->subtype == SpellSchool::AIR.getNum())
fileName = "E_LIGHT.bmp";
break;
case SpellSchool(ESpellSchool::FIRE):
if (bonus->subtype == SpellSchool::FIRE.getNum())
fileName = "E_FIRE.bmp";
break;
case SpellSchool(ESpellSchool::WATER):
if (bonus->subtype == SpellSchool::WATER.getNum())
fileName = "E_COLD.bmp";
break;
case SpellSchool(ESpellSchool::EARTH):
if (bonus->subtype == SpellSchool::EARTH.getNum())
fileName = "E_SPEATH1.bmp"; //No separate icon for earth damage
break;
}
break;
}
case BonusType::SPELL_SCHOOL_IMMUNITY: //for all school
{
switch(bonus->subtype)
{
case SpellSchool(ESpellSchool::AIR):
if (bonus->subtype == SpellSchool::AIR.getNum())
fileName = "E_SPAIR.bmp";
break;
case SpellSchool(ESpellSchool::FIRE):
if (bonus->subtype == SpellSchool::FIRE.getNum())
fileName = "E_SPFIRE.bmp";
break;
case SpellSchool(ESpellSchool::WATER):
if (bonus->subtype == SpellSchool::WATER.getNum())
fileName = "E_SPWATER.bmp";
break;
case SpellSchool(ESpellSchool::EARTH):
if (bonus->subtype == SpellSchool::EARTH.getNum())
fileName = "E_SPEATH.bmp";
break;
}
break;
}
case BonusType::NEGATIVE_EFFECTS_IMMUNITY:
{
switch(bonus->subtype)
{
case SpellSchool(ESpellSchool::AIR):
if (bonus->subtype == SpellSchool::AIR.getNum())
fileName = "E_SPAIR1.bmp";
break;
case SpellSchool(ESpellSchool::FIRE):
if (bonus->subtype == SpellSchool::FIRE.getNum())
fileName = "E_SPFIRE1.bmp";
break;
case SpellSchool(ESpellSchool::WATER):
if (bonus->subtype == SpellSchool::WATER.getNum())
fileName = "E_SPWATER1.bmp";
break;
case SpellSchool(ESpellSchool::EARTH):
if (bonus->subtype == SpellSchool::EARTH.getNum())
fileName = "E_SPEATH1.bmp";
break;
}
break;
}
case BonusType::LEVEL_SPELL_IMMUNITY:

View File

@@ -914,6 +914,4 @@ using River = RiverId;
using Road = RoadId;
using ETerrainId = TerrainId;
VCMI_LIB_NAMESPACE_END

View File

@@ -9,6 +9,8 @@
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
enum class PrimarySkill : int8_t
{
NONE = -1,

View File

@@ -213,5 +213,4 @@ namespace MappedKeys
};
}
VCMI_LIB_NAMESPACE_END

View File

@@ -26,13 +26,13 @@ namespace detail
template<typename T>
struct IsRegularClass
{
static constexpr auto value = std::is_class<T>::value && !std::is_base_of<IdTag, T>::value;
static constexpr auto value = std::is_class<T>::value && !std::is_base_of<IdentifierBase, T>::value;
};
template<typename T>
struct IsIdClass
{
static constexpr auto value = std::is_class<T>::value && std::is_base_of<IdTag, T>::value;
static constexpr auto value = std::is_class<T>::value && std::is_base_of<IdentifierBase, T>::value;
};
}
@@ -78,7 +78,7 @@ public:
template<typename T, typename std::enable_if< detail::IsIdClass<T>::value, int>::type = 0>
void push(const T & value)
{
pushInteger(static_cast<lua_Integer>(value.toEnum()));
pushInteger(static_cast<lua_Integer>(value.getNum()));
}
template<typename T, typename std::enable_if<detail::IsRegularClass<T>::value, int>::type = 0>