From 51ed7763f70273603a45dec1ca611ad3eba7f5f6 Mon Sep 17 00:00:00 2001 From: William Miller Date: Fri, 26 Jan 2024 18:44:31 -0300 Subject: Change Aegis Reset Functionality to use titan chassis ref instead of raw index (#788) The previous index passed to the method did not correspond properly with the persistent data index. Instead pass their class reference and then use that to grab the correct index. --- .../mod/scripts/vscripts/sh_progression.nut | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut index 2dc88d0d..5098dd32 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut @@ -88,7 +88,8 @@ bool function ClientCommand_SetProgression( entity player, array args ) /// Resets a specific Titan's Aegis rank back to `0` /// * `player` - The player entity to perform the action on -/// * `args` - The arguments passed from the client command. `args[0]` should be an integer corresponding to the index of the Titan to reset. +/// * `args` - The arguments passed from the client command. `args[0]` should be a string corresponding to the chassis name of the Titan to reset. +/// Valid chassis are: ion, tone, vanguard, northstar, ronin, legion, and scorch. /// /// Returns `true` on success and `false` on missing args. bool function ClientCommand_ResetTitanAegis( entity player, array args ) @@ -96,7 +97,12 @@ bool function ClientCommand_ResetTitanAegis( entity player, array args ) if ( !args.len() ) return false - int suitIndex = args[0].tointeger() + string titanRef = args[0].tolower() + if( !PersistenceEnumValueIsValid( "titanClasses", titanRef ) ) + return false + + int suitIndex = PersistenceGetEnumIndexForItemName( "titanClasses", titanRef ) + player.SetPersistentVar( "titanFDUnlockPoints[" + suitIndex + "]", 0 ) player.SetPersistentVar( "previousFDUnlockPoints[" + suitIndex + "]", 0 ) player.SetPersistentVar( "fdTitanXP[" + suitIndex + "]", 0 ) -- cgit v1.2.3