aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Miller <william-millennium@hotmail.com>2024-01-26 18:44:31 -0300
committerGitHub <noreply@github.com>2024-01-26 22:44:31 +0100
commit51ed7763f70273603a45dec1ca611ad3eba7f5f6 (patch)
tree6ac012928f6fb33f6e76db540926f4b7655997ca
parent7edb0f2e726221d99db56c434ab6757f3428651f (diff)
downloadNorthstarMods-51ed7763f70273603a45dec1ca611ad3eba7f5f6.tar.gz
NorthstarMods-51ed7763f70273603a45dec1ca611ad3eba7f5f6.zip
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.
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/sh_progression.nut10
1 files 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 2dc88d0d4..5098dd328 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<string> 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<string> args )
@@ -96,7 +97,12 @@ bool function ClientCommand_ResetTitanAegis( entity player, array<string> 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 )