1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +00:00

fix shot script canShotHit() API function

This commit is contained in:
fgenesis 2023-03-19 18:11:57 +01:00
parent 66b0aa710f
commit c11d72f8e0

View file

@ -553,7 +553,7 @@ void Shot::targetDied(Entity *target)
{ {
debugLog("removing target from shot"); debugLog("removing target from shot");
if(s->script) if(s->script)
s->script->call("targetDied", (*i), target); s->script->call("targetDied", s, target);
s->target = 0; s->target = 0;
} }
if (s->firer == target) if (s->firer == target)
@ -579,7 +579,7 @@ bool Shot::canHit(Entity *e, Bone *b)
if(!script) if(!script)
return true; // no script? always hit return true; // no script? always hit
bool hit = true; bool hit = true;
if(!script->call("canShotHit", e, b, &hit)) if(!script->call("canShotHit", this, e, b, &hit))
return true; // script failed / doesn't have the function / returned nil? hit. return true; // script failed / doesn't have the function / returned nil? hit.
return hit; // let script decide return hit; // let script decide
} }