1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-03-16 11:26:11 +00:00

Remove all articles on save state load

This commit is contained in:
jugeeya 2022-11-07 11:55:59 -08:00 committed by GitHub
parent 146146f4b9
commit 93155a2788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,6 +256,21 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor)
};
PostureModule::set_pos(module_accessor, &pos);
// All articles have ID <= 0x25
(0..=0x25).for_each(|article_idx| {
if ArticleModule::is_exist(
module_accessor,
article_idx,
) {
let article: u64 = ArticleModule::get_article(
module_accessor,
article_idx,
);
let article_object_id =
Article::get_battle_object_id(article as *mut app::Article);
ArticleModule::remove_exist_object_id(module_accessor, article_object_id as u32);
}
});
let item_mgr = *(ITEM_MANAGER_ADDR as *mut *mut app::ItemManager);
(0..ItemManager::get_num_of_active_item_all(item_mgr)).for_each(|item_idx| {
let item = ItemManager::get_active_item(item_mgr, item_idx);