-
-
Notifications
You must be signed in to change notification settings - Fork 18
Description
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;
}