Skip to content

Commit

Permalink
Merge pull request #360 from Hathoute/wpfix
Browse files Browse the repository at this point in the history
Fixed Weapons Menu
  • Loading branch information
Hexer10 committed Mar 19, 2020
2 parents 4a130b9 + eb6ef98 commit 19343db
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions addons/sourcemod/scripting/MyJailbreak/weapons.sp
Expand Up @@ -286,15 +286,15 @@ public void OnAllPluginsLoaded()
// Initialize Plugin
public void OnConfigsExecuted()
{
gc_sPrefix.GetString(g_sPrefix, sizeof(g_sPrefix));

delete g_aPrimary;
delete g_aSecondary;

delete g_hMenu1;
delete g_hMenu2;
delete g_hMenu3;
delete g_hMenu4;
gc_sPrefix.GetString(g_sPrefix, sizeof(g_sPrefix));

delete g_aPrimary;
delete g_aSecondary;

delete g_hMenu1;
delete g_hMenu2;
delete g_hMenu3;
delete g_hMenu4;

g_aPrimary = new ArrayList(128);
g_aSecondary = new ArrayList(128);
Expand Down Expand Up @@ -450,7 +450,7 @@ void GiveSavedWeaponsFix(int client)
// Select random menu item (excluding "Random" option)
int random = GetRandomInt(0, GetArraySize(g_aPrimary)-1);
g_hWeapons Item;
GetArrayArray(g_aPrimary, random, Item);
GetArrayArray(g_aPrimary, random, Item, sizeof(Item));
GivePlayerItem(client, Item.ItemName);
}
else GivePlayerItem(client, primaryWeapon[client]);
Expand All @@ -462,7 +462,7 @@ void GiveSavedWeaponsFix(int client)
// Select random menu item (excluding "Random" option)
int random = GetRandomInt(0, GetArraySize(g_aSecondary)-1);
g_hWeapons Item;
GetArrayArray(g_aSecondary, random, Item);
GetArrayArray(g_aSecondary, random, Item, sizeof(Item));
GivePlayerItem(client, Item.ItemName);
}
else GivePlayerItem(client, secondaryWeapon[client]);
Expand Down Expand Up @@ -560,7 +560,7 @@ void GiveSavedWeapons(int client)
// Select random menu item (excluding "Random" option)
int random = GetRandomInt(0, GetArraySize(g_aPrimary)-1);
g_hWeapons Item;
GetArrayArray(g_aPrimary, random, Item);
GetArrayArray(g_aPrimary, random, Item, sizeof(Item));
GivePlayerItem(client, Item.ItemName);
}
else GivePlayerItem(client, primaryWeapon[client]);
Expand All @@ -570,7 +570,7 @@ void GiveSavedWeapons(int client)
// Select random menu item (excluding "Random" option)
int random = GetRandomInt(0, GetArraySize(g_aSecondary)-1);
g_hWeapons Item;
GetArrayArray(g_aSecondary, random, Item);
GetArrayArray(g_aSecondary, random, Item, sizeof(Item));
GivePlayerItem(client, Item.ItemName);
}
else GivePlayerItem(client, secondaryWeapon[client]);
Expand Down Expand Up @@ -894,7 +894,7 @@ Handle Menu_BuildWeaponsMenu(bool primary)

for (int i=0; i<GetArraySize(g_aPrimary);++i)
{
GetArrayArray(g_aPrimary, i, Items);
GetArrayArray(g_aPrimary, i, Items, sizeof(Items));
AddMenuItem(menu, Items.ItemName, Items.desc);
}
}
Expand All @@ -907,7 +907,7 @@ Handle Menu_BuildWeaponsMenu(bool primary)

for (int i=0; i<GetArraySize(g_aSecondary);++i)
{
GetArrayArray(g_aSecondary, i, Items);
GetArrayArray(g_aSecondary, i, Items, sizeof(Items));
AddMenuItem(menu, Items.ItemName, Items.desc);
}
}
Expand Down

0 comments on commit 19343db

Please sign in to comment.