A_Fire already has ZOffset customizable, so this only makes this codepointer more generic.
Possible use is simulating linked actors (which are not supported in direct way). One of the possible workarounds is calling A_Fire every tic.
Personally I need this for my ZBlood+ mod.
Unfortunately, I am a complete n00b when it comes to anything SVN-related. I tried hard not to make any mistakes but I am unsure if this is all that should be updated.
Edit: I am particularly very unsure whether angleoffset should be added as it is now or whether it should be added to "an = (dest->angle + angleoffset) >> ANGLETOFINESHIFT"
Code: Select all
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Fire)
{
ACTION_PARAM_START(3);
ACTION_PARAM_FIXED(height,0);
ACTION_PARAM_FIXED(offset,1);
ACTION_PARAM_FIXED(angleoffset,2);
A_Fire(self, height, offset, angleoffset);
}
void A_Fire(AActor *self, int height, int offset, int angleoffset)
{
AActor *dest;
angle_t an;
dest = self->tracer;
if (dest == NULL || self->target == NULL)
return;
// don't move it if the vile lost sight
if (!P_CheckSight (self->target, dest, 0) )
return;
an = dest->angle >> ANGLETOFINESHIFT;
self->SetOrigin (dest->x + FixedMul ((24+offset)*FRACUNIT, finecosine[an+angleoffset]),
dest->y + FixedMul ((24+offset)*FRACUNIT, finesine[an+angleoffset]) ,
dest->z + height);
}