I just ran a few tests with eventAttacked not being unthrottled on the code side:Per wrote:eventAttacked() is throttled, so do not worry too much about it being called too many times.
Code: Select all
--- a/src/cluster.cpp
+++ b/src/cluster.cpp
@@ -556,11 +556,11 @@ void clustObjectSeen(BASE_OBJECT *psObj, BASE_OBJECT *psViewer)
// tell the cluster system that an object has been attacked
void clustObjectAttacked(BASE_OBJECT *psObj)
{
+ triggerEventAttacked(psObj, g_pProjLastAttacker);
if ((aClusterAttacked[psObj->cluster] + ATTACK_CB_PAUSE) < gameTime)
{
psScrCBTarget = psObj;
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_ATTACKED);
- triggerEventAttacked(psObj, g_pProjLastAttacker);
switch (psObj->type)
{
Alternatively, i could use a new event that is called, for example, eventAttackedUnthrottled(victim, attacker), so that not break existing scripts (if any).


