FlaminSarge / tf2attributes

TF2Attributes SourceMod plugin
48 stars 41 forks source link

Crash with latest 2024-04-18 gamedata #51

Closed rtldg closed 4 months ago

rtldg commented 4 months ago

(tested on windows) Example plugin that crashes the server when you spawn after Update TF2 gamedata for version 8826692 (2024-04-18) https://github.com/FlaminSarge/tf2attributes/commit/52cb6b69a93f66d684cd69ea87e77c3a63ea5afd Specifically TF2Attrib_SetByDefIndex. Maybe others though...

```C++ #include #include public void OnPluginStart() { HookEvent("player_spawn", Event_EverythingEver, EventHookMode_Post); HookEvent("post_inventory_application", Event_EverythingEver, EventHookMode_Post); } Action Event_EverythingEver(Event event, const char[] name, bool dontBroadcast) { CenterPlayer(GetClientOfUserId(event.GetInt("userid"))); return Plugin_Continue; } void CenterPlayer(int client) { if (IsFakeClient(client)) return; SetCenterAttribute(client, GetPlayerWeaponSlot(client, TFWeaponSlot_Primary)); SetCenterAttribute(client, GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary)); SetCenterAttribute(client, GetPlayerWeaponSlot(client, TFWeaponSlot_Melee)); } void SetCenterAttribute(int client, int weapon) { if (weapon == -1) // How could this happen? :thinking: return; // List of attributes at https://wiki.teamfortress.com/wiki/List_of_item_attributes // 289 == centerfire_projectile TF2Attrib_SetByDefIndex(weapon, 289, 1.0); } ```
nosoop commented 4 months ago

Should be resolved with v1.7.3.2. It looks like the previous signature matched something else; my bad.