punteroo / TF2-Item-Plugins

SourceMod plugins for TF2 that allow players to manage their weapons (australium, festivizer, unusuals, spells, war paints) and cosmetics (unusuals, paints, spell paints, halloween spells). Now with SQLite support.
GNU General Public License v3.0
31 stars 4 forks source link

Array index out-of-bounds in TF2Items_OnGiveNamedItem #29

Open HotoCocoaco opened 2 months ago

HotoCocoaco commented 2 months ago

Describe the bug Array index out-of-bounds

L 08/24/2024 - 17:26:01: [SM] Exception reported: Array index out-of-bounds (index 9, limit 9)
L 08/24/2024 - 17:26:01: [SM] Blaming: tf2itemplugin_cosmetics.smx
L 08/24/2024 - 17:26:01: [SM] Call stack trace:
L 08/24/2024 - 17:26:01: [SM]   [1] Line 812, tf2itemplugin\tf2itemplugin_cosmetics_base.sp::TF2Items_OnGiveNamedItem
L 08/24/2024 - 17:26:01: [SM]   [3] TF2_RegeneratePlayer
L 08/24/2024 - 17:26:01: [SM]   [4] Line 2418, addons/sourcemod/scripting/mge.sp::ResetPlayer
L 08/24/2024 - 17:26:01: [SM]   [5] Line 4946, addons/sourcemod/scripting/mge.sp::Timer_ResetPlayer

To Reproduce Steps to reproduce the behavior:

  1. Install this plugin on mge server.
  2. Respawn & /add
  3. Error pop up in error log.

MAX_CLASSES = 9

enum TFClassType
{
    TFClass_Unknown = 0,
    TFClass_Scout,
    TFClass_Sniper,
    TFClass_Soldier,
    TFClass_DemoMan,
    TFClass_Medic,
    TFClass_Heavy,
    TFClass_Pyro,
    TFClass_Spy,
    TFClass_Engineer
};