mirror of
https://github.com/hermansimensen/eventqueue-fix.git
synced 2025-12-07 10:28:25 +00:00
Merge pull request #3 from rtldg/func_button-ondamage
set the activator for func_button OnDamage output
This commit is contained in:
commit
d321cec549
@ -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()
|
void LoadDHooks()
|
||||||
{
|
{
|
||||||
GameData gamedataConf = LoadGameConfigFile("eventfix.games");
|
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)
|
public any Native_GetClientEvents(Handle plugin, int numParams)
|
||||||
{
|
{
|
||||||
int client = GetNativeCell(1);
|
int client = GetNativeCell(1);
|
||||||
@ -400,4 +417,4 @@ public any Native_ClearClientEvents(Handle plugin, int numParams)
|
|||||||
g_aPlayerEvents[client].Clear();
|
g_aPlayerEvents[client].Clear();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user