Reverted to use ZR Tools. Fixed class multipliers beeing reset after map configs.

SDK Hooks works, but is not yet fully compatible with weapon restrict module because of missing Weapon_CanUse event in SDK Hooks. Weapons disappear when zombies walk near them. Otherwise the extension works.
This commit is contained in:
richard
2009-11-11 22:50:19 +01:00
parent 55ecd5bb07
commit 8c1a549239
4 changed files with 18 additions and 14 deletions

View File

@ -26,7 +26,7 @@
*/
// Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used.
#define USE_SDKHOOKS
//define USE_SDKHOOKS
#pragma semicolon 1
#include <sourcemod>
@ -171,6 +171,7 @@ public OnAllPluginsLoaded()
public OnMapStart()
{
// Forward event to modules.
ClassOnMapStart();
OverlaysOnMapStart();
RoundEndOnMapStart();
InfectOnMapStart();

View File

@ -49,6 +49,16 @@ ClassOnModulesLoaded()
ClassClientSetDefaultIndexes();
}
/**
* Called when map is loading, before configs are loaded. Used for
* initializing class module.
*/
ClassOnMapStart()
{
// Clear multipliers.
ClassResetMultiplierCache();
}
/**
* Called when a client connects to the server (OnClientPutInServer).
*/

View File

@ -480,7 +480,7 @@ new String:ClassOriginalPlayerModel[MAXPLAYERS + 1][PLATFORM_MAX_PATH];
* @param keepMultipliers Optional. Don't reset multipliers. Default is
* false.
*/
ClassLoad(bool:keepMultipliers = false)
ClassLoad()
{
// Register config file.
ConfigRegisterConfig(File_Classes, Structure_Keyvalue, CONFIG_FILE_ALIAS_CLASSES);
@ -630,12 +630,6 @@ ClassLoad(bool:keepMultipliers = false)
// Reset selected class indexes for next spawn.
ClassResetNextIndexes();
// Reset attribute multipliers, if not keeping.
if (!keepMultipliers)
{
ClassResetMultiplierCache();
}
// Mark classes as valid.
ClassValidated = true;
@ -660,7 +654,7 @@ ClassLoad(bool:keepMultipliers = false)
public ClassOnConfigReload(ConfigFile:config)
{
// Reload class config.
ClassLoad(true);
ClassLoad();
}
/**