MinoMino / minqlx

Extends Quake Live's dedicated server with extra functionality and scripting.
GNU General Public License v3.0
112 stars 42 forks source link

added new hook, handler and dispatcher for any damage events happening #120

Open mgaertne opened 1 year ago

mgaertne commented 1 year ago

I hooked into G_Damage and forwarded that towards python, so that python plugins now can self.add_hook("damage", self.handle_damage) in its own function. The plugin function gets

The events can't be stopped, and are delivered regardless of whether the target actually gets health/armor reduced, i.e. from rocket jumps with DAMAGE_NO_PROTECTION not set, or team damage in the DAMAGE_NO_TEAM_PROTECTION case. You can detect harmful team shots by this. Plugins would need to filter the events they are interested in on their own.