JHGuitarFreak / UQM-MegaMod

A fork of The Ur-Quan Masters + HD-mod that remasters the HD graphics with a veritable smorgasbord of extra features, options, QoL improvements, and much more...
https://uqm-mods.sourceforge.net
GNU General Public License v2.0
80 stars 22 forks source link

IP group ships don't properly disappearing during flee phase #71

Closed Kruzen closed 4 years ago

Kruzen commented 4 years ago

I changed condition to this

if (task == FLEE && !stillInSystemWhileFleeing (GroupPtr->loc))
                    goto CheckGetAway;

where stillInSystemWhileFleeing (POINT ip_loc) is a new function:

static BOOLEAN
stillInSystemWhileFleeing (POINT ip_loc)
{
    if (ip_loc.x > -20000 && ip_loc.x < 20000 && ip_loc.y > -20000 && ip_loc.y < 20000)// system ip_location coords
        return TRUE;// ip_coords are from -18000 to 18000
                    // expanded to 20000, this prevents some ships to pop out of existense
                    // when they are barely touching screen edge
                    // so ship sprite will leave system smoothly
    return FALSE;
}