mirror of
https://github.com/hermansimensen/eventqueue-fix.git
synced 2025-12-06 18:08:27 +00:00
set the activator for func_button OnDamage output
This commit is contained in:
parent
3f55e0a7dc
commit
5978fe6153
@ -151,6 +151,14 @@ public void OnClientDisconnect(int client)
|
||||
}
|
||||
}
|
||||
|
||||
public void OnEntityCreated(int entity, const char[] classname)
|
||||
{
|
||||
if (StrEqual(classname, "func_button"))
|
||||
{
|
||||
SDKHook(entity, SDKHook_OnTakeDamage, Hook_Button_OnTakeDamage);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadDHooks()
|
||||
{
|
||||
GameData gamedataConf = LoadGameConfigFile("eventfix.games");
|
||||
@ -344,6 +352,15 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
}
|
||||
}
|
||||
|
||||
public Action Hook_Button_OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype, int& weapon, float damageForce[3], float damagePosition[3], int damagecustom)
|
||||
{
|
||||
// func_button fires the OnDamage output before setting m_hActivator to the attacker.
|
||||
// This means m_hActivator can be unset or a previous attacker.
|
||||
// This is a problem at bhop_badges level 13 and also the booster in the ladder room.
|
||||
SetEntPropEnt(victim, Prop_Data, "m_hActivator", attacker);
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public any Native_GetClientEvents(Handle plugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user