Support for new error handling.
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:
@@ -59,7 +59,7 @@ register! {
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
battle: ExternRef<Battle>,
|
||||
) -> ExternRef<StringKey> {
|
||||
let weather = battle.value_func(&env).unwrap().weather_name();
|
||||
let weather = battle.value_func(&env).unwrap().weather_name().unwrap();
|
||||
if let Some(weather) = weather {
|
||||
ExternRef::func_new(&env, &weather)
|
||||
} else {
|
||||
|
||||
@@ -10,14 +10,14 @@ register! {
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
battle_random: ExternRef<BattleRandom>,
|
||||
) -> i32 {
|
||||
battle_random.value_func(&env).unwrap().get()
|
||||
battle_random.value_func(&env).unwrap().get().unwrap()
|
||||
}
|
||||
fn battle_random_get_max(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
battle_random: ExternRef<BattleRandom>,
|
||||
max: i32
|
||||
) -> i32 {
|
||||
battle_random.value_func(&env).unwrap().get_max(max)
|
||||
battle_random.value_func(&env).unwrap().get_max(max).unwrap()
|
||||
}
|
||||
fn battle_random_get_between(
|
||||
env: FunctionEnvMut<WebAssemblyEnv>,
|
||||
@@ -25,6 +25,6 @@ register! {
|
||||
min: i32,
|
||||
max: i32
|
||||
) -> i32 {
|
||||
battle_random.value_func(&env).unwrap().get_between(min, max)
|
||||
battle_random.value_func(&env).unwrap().get_between(min, max).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ register! {
|
||||
battle_random: ExternRef<ChoiceQueue>,
|
||||
pokemon: ExternRef<Pokemon>
|
||||
) -> u8 {
|
||||
u8::from(battle_random.value_func(&env).unwrap().move_pokemon_choice_next(pokemon.value_func(&env).unwrap()))
|
||||
u8::from(battle_random.value_func(&env).unwrap().move_pokemon_choice_next(pokemon.value_func(&env).unwrap()).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ register! {
|
||||
source: u8
|
||||
) {
|
||||
unsafe{
|
||||
pokemon.value_func(&env).unwrap().damage(damage, transmute(source));
|
||||
pokemon.value_func(&env).unwrap().damage(damage, transmute(source)).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user