diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.cpp index 83769b3..734401a 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.cpp @@ -26,17 +26,17 @@ void RegisterSpeciesTypes::RegisterGenderEnum(asIScriptEngine* engine) { void RegisterSpeciesTypes::RegisterStatisticEnum(asIScriptEngine* engine) { [[maybe_unused]] int r = engine->RegisterEnum("Statistic"); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "HP", PkmnLib::Library::Statistic::HealthPoints); + r = engine->RegisterEnumValue("Statistic", "HP", (int)PkmnLib::Library::Statistic::HealthPoints); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "Attack", PkmnLib::Library::Statistic::PhysicalAttack); + r = engine->RegisterEnumValue("Statistic", "Attack", (int)PkmnLib::Library::Statistic::PhysicalAttack); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "Defense", PkmnLib::Library::Statistic::PhysicalDefense); + r = engine->RegisterEnumValue("Statistic", "Defense", (int)PkmnLib::Library::Statistic::PhysicalDefense); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "SpecialAttack", PkmnLib::Library::Statistic::SpecialAttack); + r = engine->RegisterEnumValue("Statistic", "SpecialAttack", (int)PkmnLib::Library::Statistic::SpecialAttack); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "SpecialDefense", PkmnLib::Library::Statistic::SpecialDefense); + r = engine->RegisterEnumValue("Statistic", "SpecialDefense", (int)PkmnLib::Library::Statistic::SpecialDefense); assert(r >= 0); - r = engine->RegisterEnumValue("Statistic", "Speed", PkmnLib::Library::Statistic::Speed); + r = engine->RegisterEnumValue("Statistic", "Speed", (int)PkmnLib::Library::Statistic::Speed); assert(r >= 0); } diff --git a/tests/ScriptTests/ScriptTypeTests/Library/FormesTests.cpp b/tests/ScriptTests/ScriptTypeTests/Library/FormesTests.cpp index 76f1ed9..9566e69 100644 --- a/tests/ScriptTests/ScriptTypeTests/Library/FormesTests.cpp +++ b/tests/ScriptTests/ScriptTypeTests/Library/FormesTests.cpp @@ -145,14 +145,14 @@ TEST_CASE("Validate Forme GetStatistic in Script") { auto mainLib = TestLibrary::GetLibrary(); // Iterate over each stat, ensure they return the expected value. - for (uint8_t statInt = CreatureLib::Core::Statistic::Health; statInt != CreatureLib::Core::Statistic::Speed; - statInt++) { + for (uint8_t statInt = static_cast(CreatureLib::Core::Statistic::Health); + statInt != static_cast(CreatureLib::Core::Statistic::Speed); statInt++) { auto stat = static_cast(statInt); auto data = GetScript(mainLib, "testGetStatistic"); auto forme = mainLib->GetSpeciesLibrary()->GetPkmnSpecies("testSpecies2")->GetDefaultForme(); data.Context->SetArgObject(0, const_cast(forme)); - data.Context->SetArgDWord(1, stat); + data.Context->SetArgDWord(1, static_cast(stat)); data.Context->SetArgDWord(2, forme->GetStatistic(stat)); REQUIRE(data.Context->Execute() == asEXECUTION_FINISHED); REQUIRE((bool)data.Context->GetReturnWord());