From 60d3c12955ff03ba594f16c863258994a995c39d Mon Sep 17 00:00:00 2001 From: Connie Price Date: Thu, 20 Jan 2022 19:43:23 +0000 Subject: Moved Join to a global JoinStringArray so that anyone can use it. - Added `sh_utility_all.gnut` so that we can add global utility functions to all three squirrel VMs ( UI, Client & Server ) - Also removed a rogue leftover constant. --- .../scripts/vscripts/gamemodes/sh_gamemode_gg.gnut | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'Northstar.Custom') 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 64f57f95e..2ed69819f 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_gg.gnut @@ -3,8 +3,6 @@ global function GetGunGameWeapons global const string GAMEMODE_GG = "gg" -global const string default_weapons = "mp_weapon_car|pas_run_and_gun|-1$mp_weapon_alternator_smg|pas_run_and_gun|-1$mp_weapon_hemlok_smg||-1$mp_weapon_hemlok||-1$mp_weapon_vinson|hcog|-1$mp_weapon_rspn101||-1$mp_weapon_esaw||-1$mp_weapon_lstar|pas_run_and_gun|-1$mp_weapon_shotgun||-1$mp_weapon_mastiff||-1$mp_weapon_softball||-1$mp_weapon_epg|jump_kit|-1$mp_weapon_shotgun_pistol|pas_run_and_gun|-1$mp_weapon_wingman_n|pas_run_and_gun,ricochet|-1$mp_weapon_doubletake||-1$mp_weapon_sniper|pas_fast_ads,ricochet|-1$mp_weapon_autopistol|pas_run_and_gun,temp_sight|-1$mp_weapon_semipistol|pas_run_and_gun|-1$mp_weapon_wingman|pas_run_and_gun|-1$mp_weapon_defender||-1$mp_weapon_grenade_sonar|pas_power_cell,amped_tacticals|1" - global struct GunGameWeapon { string weapon @@ -142,25 +140,10 @@ array function GetGunGameWeapons() return file.weapons } -string function Join( array strings, string separator ) -{ - string output; - - foreach( int i, string stringoStarr in strings ) - { - if (i == 0) - output = stringoStarr - else - output = output + separator + stringoStarr - } - - return output; -} - string function GGWeaponToString( GunGameWeapon ggWeapon ) { // We do it in this order because split works weirdly and won't return empty strings for gaps :c - return ggWeapon.offhandSlot + "|" + ggWeapon.weapon + "|" + Join( ggWeapon.mods, "," ) + return ggWeapon.offhandSlot + "|" + ggWeapon.weapon + "|" + JoinStringArray( ggWeapon.mods, "," ) } GunGameWeapon function StringToGGWeapon( string ggWeaponString ) -- cgit v1.2.3