Update to new Throw message.

This commit is contained in:
Deukhoofd 2021-11-21 12:42:35 +01:00
parent 2a4ec47d15
commit 9685037cf3
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 4 additions and 3 deletions

View File

@ -155,7 +155,7 @@ class BattleFunctions {
static void LearnMove(PkmnLib::Battling::Pokemon* user, const ArbUt::StringView& moveName) {
auto move = Globals::Library.GetValue()->GetMoveLibrary()->TryGet(moveName);
if (!move.has_value()) {
THROW("Unknown move: " << moveName);
THROW("Unknown move: ", moveName);
}
user->AddAttack(
new PkmnLib::Battling::LearnedMove(move.value(), CreatureLib::Battling::AttackLearnMethod::Unknown));

View File

@ -5,7 +5,8 @@
class MiscMockFunctions {
static CScriptHandle CreateMoveScript(const ArbUt::StringView& name) {
auto script = Globals::Library.GetValue()->GetScriptResolver()->LoadScript(nullptr, ScriptCategory::Attack, name);
auto script =
Globals::Library.GetValue()->GetScriptResolver()->LoadScript(nullptr, ScriptCategory::Attack, name);
if (script != nullptr) {
auto* ctx = asGetActiveContext();
TestEnvironment* env = static_cast<TestEnvironment*>(ctx->GetUserData(684));
@ -25,7 +26,7 @@ class MiscMockFunctions {
auto move = Globals::Library.GetValue()->GetMoveLibrary()->TryGet(moveName);
if (!move.has_value()) {
THROW("Unknown move: " << moveName);
THROW("Unknown move: ", moveName);
}
auto learnedMove =
new PkmnLib::Battling::LearnedMove(move.value(), CreatureLib::Battling::AttackLearnMethod::Unknown);