Skip to content

Commit

Permalink
Resetable g_weaponSlotInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Feb 1, 2024
1 parent fb9eb0d commit 2489213
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion regamedll/dlls/weapontype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2489213

Please sign in to comment.