Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
replace g_iMaxPlayers by MaxClients
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Aug 16, 2021
1 parent 4f95ded commit 654f14a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
5 changes: 2 additions & 3 deletions cstrike/addons/amxmodx/scripting/CSDM_ReAPI/csdm_core.sma
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <fakemeta>


#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define IsPlayer(%1) (1 <= %1 <= MaxClients)

const Float:MIN_RESPAWN_TIME = 0.1
const Float:MAX_RESPAWN_TIME = 15.0
Expand Down Expand Up @@ -31,7 +31,7 @@ enum forwardlist_e
new HookChain:g_hTraceAttack
new Array:g_aConfigData, Trie:g_tConfigSections, Trie:g_tConfigValues
new g_eCustomForwards[forwardlist_e]
new g_iIgnoreReturn, g_iMaxPlayers, g_iFwdEmitSound, g_iTotalItems
new g_iIgnoreReturn, g_iFwdEmitSound, g_iTotalItems

new Float:g_flRespawnDelay = MIN_RESPAWN_TIME, GameTypes:g_iGamemode
new bool:g_bShowRespawnBar, bool:g_bFreeForAll, bool:g_bBlockGunpickupSound
Expand Down Expand Up @@ -90,7 +90,6 @@ public plugin_init()
set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET)
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)

g_iMaxPlayers = get_maxplayers()
ExecuteForward(g_eCustomForwards[iFwdInitialized], g_iIgnoreReturn, CSDM_VERSION)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <hamsandwich>


#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define IsPlayer(%1) (1 <= %1 <= MaxClients)

enum
{
Expand Down Expand Up @@ -40,7 +40,7 @@ new const g_szMapEntityList[][] =
"player_weaponstrip"
}

new Trie:g_tMapEntitys, g_iFwdEntitySpawn, g_iMaxPlayers, g_iFwdSetModel
new Trie:g_tMapEntitys, g_iFwdEntitySpawn, g_iFwdSetModel
new g_bitRemoveObjects, bool:g_bRemoveWeapons, bool:g_bExcludeBomb
new HamHook:g_hWeaponBoxSpawn, HamHook:g_hShieldSpawn

Expand Down Expand Up @@ -84,8 +84,6 @@ public plugin_init()

DisableHamForward(g_hWeaponBoxSpawn = RegisterHam(Ham_Spawn, "weaponbox", "CWeaponBox_Spawn", .Post = true))
DisableHamForward(g_hShieldSpawn = RegisterHam(Ham_Spawn, "weapon_shield", "CWShield_Spawn", .Post = true))

g_iMaxPlayers = get_maxplayers()
}

public plugin_cfg()
Expand Down
5 changes: 1 addition & 4 deletions cstrike/addons/amxmodx/scripting/CSDM_ReAPI/csdm_misc.sma
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <csdm>


#define IsPlayer(%1) (1 <= (%1) <= g_iMaxPlayers)
#define IsPlayer(%1) (1 <= (%1) <= MaxClients)

const HideWeapon_Flags = 1 // "HideWeapon" msg argument

Expand All @@ -18,7 +18,6 @@ new const g_szWeaponList[][] =
new HamHook:g_hSecondaryAttack[sizeof(g_szWeaponList)], HamHook:g_hAddToPlayer[sizeof(g_szWeaponList)]

new g_bWeaponState[MAX_CLIENTS + 1][CSW_P90 + 1]
new g_iMaxPlayers

new bool:g_bWeaponStateRemember = true, g_bitHideHudFlags, g_iRefillClip = 1

Expand All @@ -32,8 +31,6 @@ public plugin_init()
DisableHamForward(g_hAddToPlayer[i] = RegisterHam(Ham_Item_AddToPlayer, g_szWeaponList[i], "CBasePlayerItem_AddToPlayer", .Post = true))
DisableHamForward(g_hSecondaryAttack[i] = RegisterHam(Ham_Weapon_SecondaryAttack, g_szWeaponList[i], "CBasePlayerItem_SecAttack", .Post = true))
}

g_iMaxPlayers = get_maxplayers()
}

public plugin_cfg()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


#define IsVectorZero(%1) (%1[X] == 0.0 && %1[Y] == 0.0 && %1[Z] == 0.0)
#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define IsPlayer(%1) (1 <= %1 <= MaxClients)

#define FIND_ENT_IN_SPHERE(%1,%2,%3) engfunc(EngFunc_FindEntityInSphere, %1, %2, %3)

Expand Down Expand Up @@ -50,7 +50,7 @@ new Float:g_vecLastOrigin[MAX_CLIENTS + 1][coord_e],
new g_pAimedEntity[MAX_CLIENTS + 1], g_iLastSpawnIndex[MAX_CLIENTS + 1], bool:g_bFirstSpawn[MAX_CLIENTS + 1]
new g_szSpawnDirectory[PLATFORM_MAX_PATH], g_szSpawnFile[PLATFORM_MAX_PATH + 32], g_szMapName[32]
new g_iTotalPoints, g_iEditorMenuID, bool:g_bEditSpawns, bool:g_bNotSaved
new g_iGravity, g_iMaxPlayers
new g_iGravity

public plugin_precache()
{
Expand All @@ -65,8 +65,6 @@ public plugin_init()
register_menucmd((g_iEditorMenuID = register_menuid(g_szEditorMenuTitle)), MENU_KEY_BITS, "EditorMenuHandler")

DisableHookChain(g_hGetPlayerSpawnSpot = RegisterHookChain(RG_CSGameRules_GetPlayerSpawnSpot, "CSGameRules_GetPlayerSpawnSpot", .post = false))

g_iMaxPlayers = get_maxplayers()
}

public plugin_cfg()
Expand Down

0 comments on commit 654f14a

Please sign in to comment.