Fixes for new CreatureLib.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-12 18:09:24 +02:00
parent ca53676b6d
commit 77eae12326
4 changed files with 4 additions and 4 deletions

View File

@@ -150,7 +150,7 @@ namespace PkmnLib::Battling {
if (!_library->GetMoveLibrary()->TryGet(moveName, move)) {
THROW_CREATURE("Invalid Move given: " << moveName.std_str());
}
if (_currentMove >= _library->GetSettings()->GetMaximalMoves()) {
if (_currentMove >= _library->GetSettings()->GetMaximalAttacks()) {
throw CreatureException("This pokemon already has the maximal allowed moves.");
}
Assert(move != nullptr);

View File

@@ -49,7 +49,7 @@ namespace PkmnLib::Battling {
public:
CreatePokemon(const BattleLibrary* library, const ArbUt::StringView& species, uint8_t level)
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalAttacks()) {
}
CreatePokemon& WithForme(const ArbUt::StringView& forme);

View File

@@ -14,7 +14,7 @@ void RegisterStaticLibraryTypes::RegisterLibrarySettingsType(asIScriptEngine* en
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalLevel), asCALL_THISCALL);
assert(r >= 0);
r = engine->RegisterObjectMethod("LibrarySettings", "uint8 get_MaximalMoves() const property",
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalMoves), asCALL_THISCALL);
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalAttacks), asCALL_THISCALL);
assert(r >= 0);
r = engine->RegisterObjectMethod("LibrarySettings", "uint16 get_ShinyRate() const property",
asMETHOD(PkmnLib::Library::LibrarySettings, GetShinyRate), asCALL_THISCALL);