-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change indentation in some macros (where rustfmt did not)
- Loading branch information
Showing
14 changed files
with
921 additions
and
921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
#[macro_export] | ||
macro_rules! on_base_object_event { | ||
($method_name:ident, $resource_name:expr, $base_object:expr) => { | ||
paste::paste! { | ||
RESOURCE_MANAGER_INSTANCE.with(|manager| { | ||
let stringified_method_name = stringify!([$method_name]); | ||
($method_name:ident, $resource_name:expr, $base_object:expr) => { | ||
paste::paste! { | ||
RESOURCE_MANAGER_INSTANCE.with(|manager| { | ||
let stringified_method_name = stringify!([$method_name]); | ||
|
||
let manager = manager.borrow(); | ||
if manager.is_pending(&$resource_name) { | ||
logger::debug!( | ||
"{} resource start is pending: {}", | ||
stringified_method_name, | ||
$resource_name | ||
); | ||
return; | ||
} | ||
let manager = manager.borrow(); | ||
if manager.is_pending(&$resource_name) { | ||
logger::debug!( | ||
"{} resource start is pending: {}", | ||
stringified_method_name, | ||
$resource_name | ||
); | ||
return; | ||
} | ||
|
||
let base_object_type = unsafe { altv_sdk::helpers::get_base_object_type($base_object.as_ptr()) }; | ||
let base_object_type = unsafe { altv_sdk::helpers::get_base_object_type($base_object.as_ptr()) }; | ||
|
||
logger::debug!( | ||
"{} type: {:?}", | ||
stringified_method_name, | ||
base_object_type | ||
); | ||
logger::debug!( | ||
"{} type: {:?}", | ||
stringified_method_name, | ||
base_object_type | ||
); | ||
|
||
manager | ||
.get_resource_for_module_by_name($resource_name) | ||
.unwrap_or_else(|| { | ||
panic!("{} resource: {:?} get_resource_for_module_by_path failed", stringified_method_name, $resource_name); | ||
}) | ||
.[<$method_name>]($base_object, base_object_type); | ||
}); | ||
} | ||
}; | ||
manager | ||
.get_resource_for_module_by_name($resource_name) | ||
.unwrap_or_else(|| { | ||
panic!("{} resource: {:?} get_resource_for_module_by_path failed", stringified_method_name, $resource_name); | ||
}) | ||
.[<$method_name>]($base_object, base_object_type); | ||
}); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.