diff --git a/scripts/zm/replaced/_zm_craftables.gsc b/scripts/zm/replaced/_zm_craftables.gsc index 9ffd958b..14f5a05c 100644 --- a/scripts/zm/replaced/_zm_craftables.gsc +++ b/scripts/zm/replaced/_zm_craftables.gsc @@ -177,4 +177,35 @@ player_progress_bar_update( start_time, craft_time ) { wait 0.05; } +} + +update_open_table_status() +{ + thread update_open_table_status_actual(); +} + +update_open_table_status_actual() +{ + wait 0.05; // wait for .crafted to be set + + b_open_craftables_remaining = 0; + + foreach ( uts_craftable in level.a_uts_craftables ) + { + if ( is_true( uts_craftable.craftablestub.is_open_table ) && !is_true( uts_craftable.crafted ) && uts_craftable.craftablespawn.craftable_name != "open_table" && uts_craftable.craftablespawn craftable_can_use_shared_piece() ) + { + b_open_craftables_remaining++; + } + } + + if ( !b_open_craftables_remaining ) + { + foreach ( uts_craftable in level.a_uts_craftables ) + { + if ( uts_craftable.craftablespawn.craftable_name == "open_table" ) + { + thread maps\mp\zombies\_zm_unitrigger::unregister_unitrigger( uts_craftable ); + } + } + } } \ No newline at end of file diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index 6a51ab31..102452e5 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -63,6 +63,7 @@ main() replaceFunc(maps\mp\zombies\_zm_craftables::choose_open_craftable, scripts\zm\replaced\_zm_craftables::choose_open_craftable); replaceFunc(maps\mp\zombies\_zm_craftables::craftable_use_hold_think_internal, scripts\zm\replaced\_zm_craftables::craftable_use_hold_think_internal); replaceFunc(maps\mp\zombies\_zm_craftables::player_progress_bar_update, scripts\zm\replaced\_zm_craftables::player_progress_bar_update); + replaceFunc(maps\mp\zombies\_zm_craftables::update_open_table_status, scripts\zm\replaced\_zm_craftables::update_open_table_status); replaceFunc(maps\mp\zombies\_zm_riotshield_prison::doriotshielddeploy, scripts\zm\replaced\_zm_riotshield_prison::doriotshielddeploy); replaceFunc(maps\mp\zombies\_zm_riotshield_prison::trackriotshield, scripts\zm\replaced\_zm_riotshield_prison::trackriotshield); replaceFunc(maps\mp\zombies\_zm_weap_riotshield_prison::init, scripts\zm\replaced\_zm_weap_riotshield_prison::init); diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index 2cda5289..bb3750c7 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -77,6 +77,7 @@ main() replaceFunc(maps\mp\zombies\_zm_craftables::choose_open_craftable, scripts\zm\replaced\_zm_craftables::choose_open_craftable); replaceFunc(maps\mp\zombies\_zm_craftables::craftable_use_hold_think_internal, scripts\zm\replaced\_zm_craftables::craftable_use_hold_think_internal); replaceFunc(maps\mp\zombies\_zm_craftables::player_progress_bar_update, scripts\zm\replaced\_zm_craftables::player_progress_bar_update); + replaceFunc(maps\mp\zombies\_zm_craftables::update_open_table_status, scripts\zm\replaced\_zm_craftables::update_open_table_status); replaceFunc(maps\mp\zombies\_zm_perk_random::trigger_visible_to_player, scripts\zm\replaced\_zm_perk_random::trigger_visible_to_player); replaceFunc(maps\mp\zombies\_zm_powerup_zombie_blood::zombie_blood_powerup, scripts\zm\replaced\_zm_powerup_zombie_blood::zombie_blood_powerup); replaceFunc(maps\mp\zombies\_zm_riotshield_tomb::doriotshielddeploy, scripts\zm\replaced\_zm_riotshield_tomb::doriotshielddeploy);