Attano / L4D2-Competitive-Framework

This repository contains the most up-to-date plugins(both binaries and sources), extensions, vscripts and shared settings files. Configs such as ProMod and Equilibrium rely on this framework.
GNU General Public License v3.0
31 stars 38 forks source link

A fixes some incorrect code around plugins used player_hurt event hooks #17

Closed Electr0 closed 7 years ago

Electr0 commented 7 years ago

I have server on SM 1.7, and got crash https://crash.limetech.org/h372ttedqwvo in config Hunters 2x2 from promod very same as https://www.l4dnation.com/server-zone/segmentation-faults-again/msg43563/#msg43563 posted in 2015.

I use plugins in folder /optional from a last eq3.0. After look code in this repository for plugins loaded in config Hunters 2x2 and have "player_hurt" event hook with a hook parameter EventHookMode_Post. I see some incorect code.

What i change:

  1. fixed missing "Action:" in event callback bodies.
  2. removed "return;" logic where this not need, and where possible can cause random crashes (after return operation in event callback) on new version of SM 1.7.X and newest (see https://www.l4dnation.com/server-zone/segmentation-faults-again/msg43563/#msg43563), i think this by old compilied versions of plugins have a incorrect a callback body format in together with waste "return;" operations not needed in cases what i fixed, this should be fix automaticaly by code interpretator of SM but in some situations.. may be some wrong..)
  3. optimized some checks (for example IsClientConnected(client) before IsClientInGame(client) now not need, this included in IsClientInGame(client) after 1.5 or 1.6 sm)
  4. fixed compilier errors in l4d2_melee_shenanigans.sp where used global "i" var a declared in includes of core sourcemod, i just renamed this variable to iTick.

Signed-off-by: electr0w electroshoc.m@gmail.com

Attano commented 7 years ago

Thanks for the commit, I'll make sure to let the authors know they screwed up. 😁