A lot more work on WASM script execution
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:
3
src/dynamic_data/models/executing_move.rs
Normal file → Executable file
3
src/dynamic_data/models/executing_move.rs
Normal file → Executable file
@@ -15,6 +15,7 @@ use crate::{PkmnResult, PokemonError};
|
||||
|
||||
/// A hit data is the data for a single hit, on a single target.
|
||||
#[derive(Default, Debug)]
|
||||
#[cfg_attr(feature = "wasm", derive(unique_type_id_derive::UniqueTypeId))]
|
||||
pub struct HitData {
|
||||
/// Whether or not the hit is critical.
|
||||
critical: AtomicBool,
|
||||
@@ -158,7 +159,7 @@ impl ExecutingMove {
|
||||
}
|
||||
|
||||
/// Gets a hit data for a target, with a specific index.
|
||||
pub fn get_hit_data<'func>(&'func self, for_target: &'func Arc<Pokemon>, hit: u8) -> PkmnResult<&'func HitData> {
|
||||
pub fn get_hit_data(&self, for_target: &Pokemon, hit: u8) -> PkmnResult<&HitData> {
|
||||
for (index, target) in self.targets.iter().enumerate() {
|
||||
if let Some(target) = target {
|
||||
if std::ptr::eq(target.deref().deref(), for_target.deref().deref()) {
|
||||
|
||||
Reference in New Issue
Block a user