aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
diff options
context:
space:
mode:
authorNoCatt <86153630+NoCatt@users.noreply.github.com>2024-02-29 00:37:57 +0100
committerGitHub <noreply@github.com>2024-02-29 00:37:57 +0100
commit51eb5eade9aedd69b64a293e95c008a8a8d1f908 (patch)
treed6242fee4c3df52c0ee2a7402f1fafeb26daa9b8 /Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
parentf2041fbb144707e68c8c772d418479b6ac53bf07 (diff)
downloadNorthstarMods-51eb5eade9aedd69b64a293e95c008a8a8d1f908.tar.gz
NorthstarMods-51eb5eade9aedd69b64a293e95c008a8a8d1f908.zip
Add weapon dropped callbackv1.24.3-rc2v1.24.3-rc1
Adds a callback for when a weapon is dropped. In the progress this also fixes weapons still dropping unintentionally in certain case.
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut20
1 files changed, 4 insertions, 16 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
index 63756fdc8..141cfe15b 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
@@ -51,8 +51,6 @@ void function SvLoadoutsMP_Init()
AddClientCommandCallback( "InGameMPMenuClosed", ClientCommandCallback_InGameMPMenuClosed )
AddClientCommandCallback( "LoadoutMenuClosed", ClientCommandCallback_LoadoutMenuClosed )
}
-
- AddCallback_OnPlayerKilled( DestroyDroppedWeapon )
}
void function SetLoadoutGracePeriodEnabled( bool enabled )
@@ -62,20 +60,10 @@ void function SetLoadoutGracePeriodEnabled( bool enabled )
void function SetWeaponDropsEnabled( bool enabled )
{
- file.weaponDropsEnabled = enabled
-}
-
-void function DestroyDroppedWeapon( entity victim, entity attacker, var damageInfo )
-{
- if ( !file.weaponDropsEnabled && IsValid( victim.GetActiveWeapon() ) )
- thread DelayDestroyDroppedWeapon( victim.GetActiveWeapon() )
-}
-
-void function DelayDestroyDroppedWeapon( entity weapon )
-{
- WaitEndFrame()
- if ( IsValid( weapon ) )
- weapon.Destroy()
+ if( enabled )
+ FlagSet( "WeaponDropsAllowed" )
+ else
+ FlagClear( "WeaponDropsAllowed" )
}
void function AddCallback_OnTryGetTitanLoadout( TryGetTitanLoadoutCallbackType callback )