From 2489213127db3b73cb2946ce8fe076053dbb9880 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 1 Feb 2024 12:21:23 +0700 Subject: [PATCH] Resetable g_weaponSlotInfo --- regamedll/dlls/weapontype.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/weapontype.cpp b/regamedll/dlls/weapontype.cpp index 2b8ae4458..dd7dc0f82 100644 --- a/regamedll/dlls/weapontype.cpp +++ b/regamedll/dlls/weapontype.cpp @@ -290,7 +290,7 @@ AmmoInfoStruct g_ammoInfo_default[] = AmmoInfoStruct g_ammoInfo[ARRAYSIZE(g_ammoInfo_default)]; -WeaponSlotInfo g_weaponSlotInfo[] = { +WeaponSlotInfo g_weaponSlotInfo_default[] = { { WEAPON_C4, C4_SLOT, "weapon_c4" }, { WEAPON_KNIFE, KNIFE_SLOT, "weapon_knife" }, { WEAPON_P228, PISTOL_SLOT, "weapon_p228" }, @@ -324,6 +324,8 @@ WeaponSlotInfo g_weaponSlotInfo[] = { { WEAPON_SHIELDGUN, NONE_SLOT, "weapon_shield" }, }; +WeaponSlotInfo g_weaponSlotInfo[ARRAYSIZE(g_weaponSlotInfo_default)]; + // Given an alias, return the associated weapon ID WeaponIdType AliasToWeaponID(const char *alias) { @@ -566,6 +568,7 @@ void WeaponInfoReset() { Q_memcpy(g_weaponInfo, g_weaponInfo_default, sizeof(g_weaponInfo)); Q_memcpy(g_ammoInfo, g_ammoInfo_default, sizeof(g_ammoInfo)); + Q_memcpy(g_weaponSlotInfo, g_weaponSlotInfo_default, sizeof(g_weaponSlotInfo)); } WeaponSlotInfo *GetWeaponSlot(WeaponIdType weaponID)