diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-14 02:20:10 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-14 02:20:10 +0000 |
commit | 1b6e5af70bf442c684b891003e516329b190c130 (patch) | |
tree | b8df2155f13ac612bfa45bfadf783b3789f117cb /Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut | |
parent | 4eaace462efe15328fcc171f2c7f85ff29a9e821 (diff) | |
download | NorthstarMods-1b6e5af70bf442c684b891003e516329b190c130.tar.gz NorthstarMods-1b6e5af70bf442c684b891003e516329b190c130.zip |
various fixes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut index 150de8bb..0be171d1 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut @@ -31,23 +31,20 @@ void function HandleXPGainForScoreEvent( entity player, ScoreEvent event ) // note: obviously all xp stuff can be cheated in if people want to on customs, this is mainly just here for fun for those who want it and feature completeness // most score events don't have this, so we'll set this to the xp value of other categories later if needed int xpValue = ScoreEvent_GetXPValue( event ) - - entity activeWeapon = player.GetActiveWeapon() int weaponXp = ScoreEvent_GetXPValueWeapon( event ) - if ( weaponXp != 0 && ShouldTrackXPForWeapon( activeWeapon.GetWeaponClassName() ) ) - { - AddWeaponXP( player, ScoreEvent_GetXPValueWeapon( event ) ) - if ( xpValue < weaponXp ) - xpValue = weaponXp - } - int titanXp = ScoreEvent_GetXPValueTitan( event ) - if ( titanXp != 0 && player.IsTitan() ) - { - AddTitanXP( player, ScoreEvent_GetXPValueTitan( event ) ) - if ( xpValue < titanXp ) - xpValue = titanXp - } + + if ( xpValue < weaponXp ) + xpValue = weaponXp + else if ( xpValue < titanXp ) + xpValue = titanXp + + if ( ShouldTrackXPForWeapon( player.GetActiveWeapon().GetWeaponClassName() ) ) + AddWeaponXP( player, xpValue ) + + // if we specifically gain titan xp, then give titan xp no matter what, otherwise only give it when we're in a titan + if ( titanXp != 0 || player.IsTitan() ) + AddTitanXP( player, xpValue ) // most events don't have faction xp but almost everything should give it int factionXp = ScoreEvent_GetXPValueFaction( event ) |