Fixes for new CreatureLib.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user