From 8036197f7d7b74b3a9b88465106874e1a2edf48d Mon Sep 17 00:00:00 2001 From: Connie Price Date: Wed, 19 Jan 2022 21:34:30 +0000 Subject: Fixed gungame meter gamemode check. --- .../vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut | 12 +++++++++++- .../mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'Northstar.Custom/mod') diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut index 0428ecfa7..d3e506ce5 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/gg_earn_meter/sh_gg_earn_meter.gnut @@ -1,12 +1,22 @@ global function Sh_GGEarnMeter_Init -void function Sh_GGEarnMeter_Init() +struct { + string gamemode = "" +} file + +void function Sh_GGEarnMeter_Init(string gamemode) +{ + file.gamemode = gamemode + AddCallback_OnRegisteringCustomNetworkVars( RegisterSharedNetwork ) } void function RegisterSharedNetwork() { + if ( GAMETYPE != file.gamemode ) + return + RegisterNetworkedVariable( "gunGameLevelPercentage", SNDC_PLAYER_EXCLUSIVE, SNVT_FLOAT_RANGE, 0.0, 0.0, 1.0 ) Remote_RegisterFunction( "ServerCallback_GGEarnMeter_SetWeaponIcon" ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut index 42d264d93..477f328a5 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut @@ -19,8 +19,7 @@ void function Sh_GamemodeGG_Init() // create custom gamemode AddCallback_OnCustomGamemodesInit( CreateGamemodeGG ) - if ( GAMETYPE != GAMEMODE_GG ) - Sh_GGEarnMeter_Init() + Sh_GGEarnMeter_Init(GAMEMODE_GG) } void function CreateGamemodeGG() -- cgit v1.2.3