From cfa407613090a3cc7bc6afc21f0b6a89e93d8423 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Wed, 5 Apr 2023 01:28:54 -0700 Subject: [PATCH] Reset quest completion from replaceFunc --- scripts/zm/_zm_reimagined.gsc | 10 ++-------- scripts/zm/replaced/_zm_stats.gsc | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 scripts/zm/replaced/_zm_stats.gsc diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index e751e379..234cfcc0 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -6,6 +6,7 @@ #include scripts\zm\replaced\utility; #include scripts\zm\replaced\zm_melee; #include scripts\zm\replaced\_zm; +#include scripts\zm\replaced\_zm_stats; #include scripts\zm\replaced\_zm_playerhealth; #include scripts\zm\replaced\_zm_utility; #include scripts\zm\replaced\_zm_score; @@ -44,6 +45,7 @@ main() replaceFunc(maps\mp\zombies\_zm::player_revive_monitor, scripts\zm\replaced\_zm::player_revive_monitor); replaceFunc(maps\mp\zombies\_zm::player_out_of_playable_area_monitor, scripts\zm\replaced\_zm::player_out_of_playable_area_monitor); replaceFunc(maps\mp\zombies\_zm::end_game, scripts\zm\replaced\_zm::end_game); + replaceFunc(maps\mp\zombies\_zm_stats::set_global_stat, scripts\zm\replaced\_zm_stats::set_global_stat); replaceFunc(maps\mp\zombies\_zm_playerhealth::playerhealthregen, scripts\zm\replaced\_zm_playerhealth::playerhealthregen); replaceFunc(maps\mp\zombies\_zm_utility::track_players_intersection_tracker, scripts\zm\replaced\_zm_utility::track_players_intersection_tracker); replaceFunc(maps\mp\zombies\_zm_utility::is_headshot, scripts\zm\replaced\_zm_utility::is_headshot); @@ -143,7 +145,6 @@ onplayerconnect() player thread onplayerspawned(); player thread onplayerdowned(); - player thread reset_sq_completed(); player thread weapon_inspect_watcher(); } } @@ -387,13 +388,6 @@ set_perks() self setperk( "specialty_fastladderclimb" ); } -reset_sq_completed() -{ - player maps\mp\zombies\_zm_stats::set_global_stat( "sq_transit_last_completed", 0 ); - player maps\mp\zombies\_zm_stats::set_global_stat( "sq_highrise_last_completed", 0 ); - player maps\mp\zombies\_zm_stats::set_global_stat( "sq_buried_last_completed", 0 ); -} - health_bar_hud() { self endon("disconnect"); diff --git a/scripts/zm/replaced/_zm_stats.gsc b/scripts/zm/replaced/_zm_stats.gsc new file mode 100644 index 00000000..235fcc07 --- /dev/null +++ b/scripts/zm/replaced/_zm_stats.gsc @@ -0,0 +1,19 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\gametypes_zm\_globallogic_score; +#include maps\mp\zombies\_zm_pers_upgrades; +#include maps\mp\zombies\_zm_weapons; +#include maps\mp\gametypes_zm\_globallogic; +#include maps\mp\zombies\_zm_stats; + +set_global_stat( stat_name, value ) +{ + if ( is_true( level.zm_disable_recording_stats ) ) + return; + + if ( issubstr( tolower( stat_name ), "sq_" ) || issubstr( tolower( stat_name ), "navcard_" ) ) + value = 0; + + self setdstat( "PlayerStatsList", stat_name, "StatValue", value ); +} \ No newline at end of file