From 2a90d06d903f4a4467af715dcf9eb7db51be6a79 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Wed, 17 Oct 2018 04:28:47 +1100 Subject: [PATCH] move some weapon drop modules --- .../irresistible/cnr/features/weapon_drop.pwn | 15 +++++++++++---- gamemodes/sf-cnr.pwn | 5 ----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/weapon_drop.pwn b/gamemodes/irresistible/cnr/features/weapon_drop.pwn index b4712ed..7123c1a 100644 --- a/gamemodes/irresistible/cnr/features/weapon_drop.pwn +++ b/gamemodes/irresistible/cnr/features/weapon_drop.pwn @@ -13,8 +13,6 @@ #error "This module requires weapon data functions" #endif -#define WEAPON_DROP_ENABLED - /* ** Definitions ** */ #define MAX_WEAPON_DROPS ( 100 ) @@ -41,6 +39,12 @@ hook OnGameModeInit( ) return 1; } +hook OnServerUpdate( ) +{ + ClearInactiveWeaponDrops( ); + return 1; +} + #if defined AC_INCLUDED hook OnPlayerDeathEx( playerid, killerid, reason, Float: damage, bodypart ) #else @@ -394,7 +398,7 @@ stock CreateWeaponPickup( weaponid, ammo, slotid, Float: X, Float: Y, Float: Z, } else { - ClearInactiveWeaponDrops( gettime( ) ); + ClearInactiveWeaponDrops( ); } return handle; } @@ -409,8 +413,11 @@ stock DestroyWeaponPickup( handle ) return 1; } -stock ClearInactiveWeaponDrops( global_timestamp ) +stock ClearInactiveWeaponDrops( ) { + new + global_timestamp = GetServerTime( ); + foreach ( new dropid : weapondrop ) if ( g_weaponDropData[ dropid ] [ E_EXPIRE_TIMESTAMP ] != 0 && global_timestamp > g_weaponDropData[ dropid ] [ E_EXPIRE_TIMESTAMP ] ) { new diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index b7ad2d2..85ba883 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -948,11 +948,6 @@ public OnServerUpdateTimer( ) // Restore and Replenish Stuff if ( g_iTime > g_RestoreRobberiesBribes ) { - #if defined WEAPON_DROP_ENABLED - // Replenish Weapon Drops - ClearInactiveWeaponDrops( g_iTime ); - #endif - // Replenish Vaults for( new i = 0; i < sizeof( g_bankvaultData ); i++ ) if ( g_bankvaultData[ i ] [ E_DISABLED ] && g_iTime > g_bankvaultData[ i ] [ E_TIMESTAMP_CLOSE ] ) {