aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
authorDBmaoha <56738369+DBmaoha@users.noreply.github.com>2023-07-11 00:22:52 +0800
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-11 01:33:40 +0200
commit429fe2117c6d6ffec558511426e43595910665ee (patch)
tree7748c7199c9f947e54c949653fae6f818ac04d2c /Northstar.CustomServers/mod
parent2d073a3dd22988ed7386dae21da350613bb27b5b (diff)
downloadNorthstarMods-1.16.2.tar.gz
NorthstarMods-1.16.2.zip
Prematch now cleans up boosts (#568)v1.16.2-rc1v1.16.2
* 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> (cherry picked from commit d23828da5b08ce06c8385ec4ff5002afbd9a9b82)
Diffstat (limited to 'Northstar.CustomServers/mod')
-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 ]