Fixes assert not throwing exceptions for PkmnLibAI, now always throws exceptions if non-zero response.

This commit is contained in:
Deukhoofd 2021-04-30 13:53:16 +02:00
parent 12850e3771
commit 3cb243175c
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,16 @@ namespace PkmnLibSharp.Utilities
var stack = Pkmnlib.Generated.C.GetLastExceptionStacktrace().PtrString(); var stack = Pkmnlib.Generated.C.GetLastExceptionStacktrace().PtrString();
throw new NativeException("PkmnLib", message, stack); throw new NativeException("PkmnLib", message, stack);
} }
case 5:
{
var message = PkmnLibAI.Generated.C.GetLastException().PtrString()!;
var stack = PkmnLibAI.Generated.C.GetLastExceptionStacktrace().PtrString();
throw new NativeException("PkmnLibAI", message, stack);
}
default:
{
throw new NativeException("Undefined", "", "");
}
} }
} }
} }