View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 09-01-2020 , 14:00   [L4D & L4D2] Reload Fix - Max Clip Size (1.5) [21-Apr-2024]
Reply With Quote #1

Fixes:
  • Reload animation glitching when a modified clip size is full.
  • Shotgun animation stopping after reloading 15 bullets.

When using Left4DHooks L4D2_SetIntWeaponAttribute(classname, L4D2IWA_ClipSize, XX);
- OR -
Info Editor to modify "clip_size" key value.
- OR -
some other method to modify the clip size e.g. directly modifying weapon.txt script files (L4D1).


For some reason detouring "CTerrorGun::Reload" using the VTable method kept crashing, so I've gone with using signatures.


Related Plugins:


Cvars:

Saved to l4d_reload_fix.cfg in your servers \cfg\sourcemod\ folder.

PHP Code:
l4d_reload_fix_m60 "0" // 0=Off, 1=Fix the M60 from reload bug issues. 


Changes:
Code:
1.5 (21-Apr-2024)
    - Added cvar "l4d_reload_fix_m60" to control if the M60 should be fixed or not, since I encounter no bug with changed clip size.
    - Fixed the Grenade Launcher and M60 playing the reload animation when a modified clip size is full. Thanks to "chungocanh12" for reporting.

1.4 (07-Nov-2023)
    - Fixed not deleting 2 handles. Thanks to "HarryPotter" for reporting.

1.3a (08-Sep-2021)
    - GameData file updated. Wildcarded "CTerrorGun::Reload" to support other plugins detouring this function.
    - Thanks to "vikingo12" for reporting.

1.3 (05-Jul-2021)
    - L4D2: Added support for the "weapon_smg_mp5" weapon. Thanks to "Alexmy" for reporting.

1.2 (29-Jun-2021)
    - L4D2: Added support for the Magnum "weapon_pistol_magnum" pistol.

1.1b (17-Jun-2021)
    - Compatibility update for L4D2's "2.2.1.3" game update. Thanks to "Crasher_3637" for fixing.
    - GameData .txt file updated.

1.1a (24-Sep-2020)
    - Compatibility update for L4D2's "The Last Stand" update.
    - GameData .txt file updated.

1.1 (05-Sep-2020)
    - Now prevents changing anything when the max clip size is unchanged.
    - Added a fix for shotgun reload animation stopping when reloading >= 15 bullets at one time.
    - Thanks to "fbef0102" for reporting.
    - GameData file updated.

1.0 (25-Aug-2020)
    - Initial release.


Requirements:
  1. SourceMod 1.11 or newer
  2. -OR-
  3. DHooks (Experimental Dynamic Detour support) and manually compiling the plugin
  4. L4D2 only: Left 4 DHooks Direct plugin.


Installation:
DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires DHooks!
  1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.
  2. Download "l4d_reload_fix.txt" and put the file into your servers \addons\sourcemod\gamedata\ folder.

Updating from 1.0:
  • GameData .txt file must be updated.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_reload_fix.sp - 59 views - 12.9 KB)
File Type: smx l4d_reload_fix.smx (7.2 KB, 75 views)
File Type: txt l4d_reload_fix.txt (1.8 KB, 1247 views)
__________________

Last edited by Silvers; 04-21-2024 at 11:12.
Silvers is offline