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
target player (the player receiving the damage)
attacker (optional player, that caused the damage, might be None for environmental damage inflicted)
damage (amount of damage the target might receive)
dflags (bitfield of damage flags, i.e. DAMAGE_NO_PROTECTION or DAMAGE_NO_TEAM_PROTECTION)
mod (means of death, indicating where this damage might be coming from)
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.
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.