Skip to content

[Bug] TNT and fireball tracking cancels all tnt and fireball spawning #149

@DerToaster98

Description

@DerToaster98

Issue

TNT and fireball tracking both use MathUtils.fastNearestCraftToLoc in their relevant Tracking classes.
They use this to I assume find the craft that the tnt or fireball spawns on.

However, no validation is being performed here. So technically, as long as there is at least one sinking or disabled craft in the world (depending on whatever option is enabled), ALL tnts and fireballs getting spawned will be removed as it WILL find a craft that is "closest" to that location.

Reproducing

Simplest way is to put a tnt dispensers above a skiff but that is not part of the skiff. Pilot the skiff, hook the dispenser to a clock and let it sink the skiff. As soon as the skiff starts sinking, the tnts getting spawned by that dispenser will be removed upon spawning.

Solution

Simply put these two checks directly after calling getNearestCraftToLoc()

if (!(craft.getHitBox().inBounds(tnt.getLocation()) && craft.getHitBox().contains(tnt.getLocation())) {
    return;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions