aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDBmaoha <56738369+DBmaoha@users.noreply.github.com>2023-07-11 00:22:52 +0800
committerGitHub <noreply@github.com>2023-07-10 18:22:52 +0200
commitd23828da5b08ce06c8385ec4ff5002afbd9a9b82 (patch)
tree780dfbd9ab6a1a0777937e2f128f758712f29a54
parent41f104e5f40654948dccfefd169152d47064c6ae (diff)
downloadNorthstarMods-d23828da5b08ce06c8385ec4ff5002afbd9a9b82.tar.gz
NorthstarMods-d23828da5b08ce06c8385ec4ff5002afbd9a9b82.zip
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>
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut9
1 files changed, 9 insertions, 0 deletions
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 7d4552a0..9057f7d8 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<InventoryItem> playerInventoryStack = file.playerInventoryStacks[ player ]