punteroo/TF2-Item-Plugins

Errors in 3.0.1 update

mintoyatsu opened this issue · 2 comments

Describe the bug

New players are connecting to the server with TF_WEAPON_BAT equipped regardless of the class they're on, the only way to get rid of this is to "RESET EVERYTHING" through the menu, which brings back the normal weapon. Also, Unusual effects aren't showing in the menu even with the convar enabled.

Screenshot

L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> szClassname = 
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iItemDefinitionIndex = 0
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iEntityQuality = 5
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iEntityLevel = 74
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 134
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2027
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2022
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 542
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2053
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2025
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2014
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 2013
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 834
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 725
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 1009
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 1008
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 1007
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 0.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> iAttributeDefinitionIndex = 150
L 10/13/2021 - 21:06:55: [TF2ITEMS] >>> flValue = 1.000000
L 10/13/2021 - 21:06:55: [TF2ITEMS] ---------------------------------------
L 10/13/2021 - 21:06:55: [SM] Exception reported: Item is NULL. File a bug report if you are sure you set all the data correctly. (Try the FORCE_GENERATION flag.)
L 10/13/2021 - 21:06:55: [SM] Blaming: tf2item_weapons.smx
L 10/13/2021 - 21:06:55: [SM] Call stack trace:
L 10/13/2021 - 21:06:55: [SM]   [0] TF2Items_GiveNamedItem
L 10/13/2021 - 21:06:55: [SM]   [1] Line 776, tf2item_weapons.sp::GivePostWeapon
L 10/13/2021 - 21:06:55: [SM]   [2] Line 754, tf2item_weapons.sp::ApplyChanges
L 10/13/2021 - 21:06:55: [SM]   [3] Line 765, tf2item_weapons.sp::GiveStrangeWeapon
L 10/13/2021 - 21:06:55: [SM]   [4] Line 612, tf2item_weapons.sp::GiveSpecialWeapon
L 10/13/2021 - 21:06:55: [SM]   [5] Line 582, tf2item_weapons.sp::OnPlayerSpawn

This is caused because the weapon preferences enum struct wasn't setting correctly -1 on connection to all override settings, causing a wrong initialization to 0.

This would cause the check for an override to fail (because 0 > -1 and WeaponsInfo.Special initializes on 0) (oops!) giving the player the weapon with iItemDefinitionIndex on 0 (The Stock Bat). Fixed with 49a754b

The issue why Unusual Overrides are not showing up regardless of the ConVar value is because of a misplaced parenthesis (another oopsie, now that's embarrassing!). Fixed with d6e9fdf

I'm issuing a hotfix for this issue as we speak. Should be up shortly. Thank you for spotting something that really flew over my head.

This has been fixed on latest release v3.0.2

Thank you so much for reporting this issue!
https://github.com/punteroo/TF2-Item-Plugins/releases/tag/v3.0.2