Loads of work to replace panics with results.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::dynamic_data::{LearnedMove, MoveLearnMethod};
|
||||
use crate::ffi::{ExternPointer, IdentifiablePointer, OwnedPtr};
|
||||
use crate::ffi::{ExternPointer, IdentifiablePointer, NativeResult, OwnedPtr};
|
||||
use crate::static_data::MoveData;
|
||||
use std::ptr::drop_in_place;
|
||||
use std::sync::Arc;
|
||||
@@ -60,6 +60,6 @@ extern "C" fn learned_move_restore_all_uses(learned_move: ExternPointer<Arc<Lear
|
||||
|
||||
/// Restore the remaining PP by a certain amount. Will prevent it from going above max PP.
|
||||
#[no_mangle]
|
||||
extern "C" fn learned_move_restore_uses(learned_move: ExternPointer<Arc<LearnedMove>>, amount: u8) {
|
||||
learned_move.as_ref().restore_uses(amount);
|
||||
extern "C" fn learned_move_restore_uses(learned_move: ExternPointer<Arc<LearnedMove>>, amount: u8) -> NativeResult<()> {
|
||||
learned_move.as_ref().restore_uses(amount).into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user