mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-22 22:36:10 +00:00
Keep Crafting Table on state load (#448)
* Keep Crafting Table on state load * Better Table Reference * Use for..in loop for clearer code * Remove Crafting Table jugeeya edition
This commit is contained in:
parent
01a2c60a29
commit
c7457cf0fd
1 changed files with 14 additions and 11 deletions
|
@ -261,17 +261,20 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor)
|
||||||
PostureModule::set_pos(module_accessor, &pos);
|
PostureModule::set_pos(module_accessor, &pos);
|
||||||
|
|
||||||
// All articles have ID <= 0x25
|
// All articles have ID <= 0x25
|
||||||
(0..=0x25).for_each(|article_idx| {
|
(0..=0x25)
|
||||||
if ArticleModule::is_exist(module_accessor, article_idx) {
|
// Don't remove crafting table
|
||||||
let article: u64 = ArticleModule::get_article(module_accessor, article_idx);
|
.filter(|article_idx| !(fighter_kind == *FIGHTER_KIND_PICKEL && *article_idx == *FIGHTER_PICKEL_GENERATE_ARTICLE_TABLE))
|
||||||
let article_object_id =
|
.for_each(|article_idx| {
|
||||||
Article::get_battle_object_id(article as *mut app::Article);
|
if ArticleModule::is_exist(module_accessor, article_idx) {
|
||||||
ArticleModule::remove_exist_object_id(
|
let article: u64 = ArticleModule::get_article(module_accessor, article_idx);
|
||||||
module_accessor,
|
let article_object_id =
|
||||||
article_object_id as u32,
|
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);
|
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| {
|
(0..ItemManager::get_num_of_active_item_all(item_mgr)).for_each(|item_idx| {
|
||||||
let item = ItemManager::get_active_item(item_mgr, item_idx);
|
let item = ItemManager::get_active_item(item_mgr, item_idx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue