From a5693efce5118a19087c2ad14f90fec5702f5e90 Mon Sep 17 00:00:00 2001 From: Southclaw Date: Mon, 31 Oct 2016 20:35:53 +0000 Subject: [PATCH] fixed spawn items bug (#306) --- BUILD_NUMBER | 2 +- gamemodes/sss/core/player/spawn.pwn | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BUILD_NUMBER b/BUILD_NUMBER index 95fa1c9d..0a30b7dc 100644 --- a/BUILD_NUMBER +++ b/BUILD_NUMBER @@ -1 +1 @@ -1186 \ No newline at end of file +1192 \ No newline at end of file diff --git a/gamemodes/sss/core/player/spawn.pwn b/gamemodes/sss/core/player/spawn.pwn index abe21305..847b6dcd 100644 --- a/gamemodes/sss/core/player/spawn.pwn +++ b/gamemodes/sss/core/player/spawn.pwn @@ -41,15 +41,18 @@ forward OnPlayerSpawnChar(playerid); forward OnPlayerSpawnNewChar(playerid); -hook OnScriptInit() +hook OnGameModeInit() { - print("\n[OnScriptInit] Initialising 'Player/Spawn'..."); + print("\n[OnGameModeInit] Initialising 'Player/Spawn'..."); new bagtype[ITM_MAX_NAME]; GetSettingString("spawn/bagtype", "Satchel", bagtype); spawn_BagType = GetItemTypeFromUniqueName(bagtype, true); + if(!IsValidItemType(spawn_BagType)) + printf("ERROR: spawn/bagtype item name '%s' results in invalid item type %d", bagtype, _:spawn_BagType); + // todo: make this better. spawn_ReSpawnItems[0][e_itmobj_type] = item_AntiSepBandage; spawn_ReSpawnItems[1][e_itmobj_type] = item_Knife;