From d23828da5b08ce06c8385ec4ff5002afbd9a9b82 Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Tue, 11 Jul 2023 00:22:52 +0800 Subject: Prematch now cleans up boosts (#568) * Initial Commit * update format * update to use https://github.com/R2Northstar/NorthstarMods/pull/565's function * remove random whitespace * github suggestions nuked the line and i dont know why --------- Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> --- .../mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut b/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut index 7d4552a0e..9057f7d8b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut @@ -20,6 +20,7 @@ void function Sv_ItemInventory_Init() { AddCallback_OnClientConnected( Sv_ItemInventory_OnClientConnected ) AddCallback_OnPlayerGetsNewPilotLoadout( Sv_ItemInventory_OnPlayerGetsNewPilotLoadout ) + AddCallback_GameStateEnter( eGameState.Prematch, PrematchClearInventory ) } void function Sv_ItemInventory_OnClientConnected( entity player ) @@ -27,6 +28,14 @@ void function Sv_ItemInventory_OnClientConnected( entity player ) file.playerInventoryStacks[ player ] <- [] } +void function PrematchClearInventory() // vanilla behavior +{ + foreach( entity player in GetPlayerArray() ) + { + PlayerInventory_TakeAllInventoryItems( player ) + } +} + void function Sv_ItemInventory_OnPlayerGetsNewPilotLoadout( entity player, PilotLoadoutDef newPilotLoadout ) { array playerInventoryStack = file.playerInventoryStacks[ player ] -- cgit v1.2.3