When a hex needs to be removed from the h3dex, it may also require rebuilding the targeting lookup for h3dex-based targeting if the parent hex (at the targeting resolution) becomes empty as well. However, due to a bug, this check may not be working as expect leaving the hex in the h3dex. The current code is checking for the count of gateways in the parent hex before removing the gateway from that hex. Instead, it should remove the gateway's hex and then check if that results in the parent hex now being empty.
This change is behind a chain var as to to allow it to be made after h3dex activation.
When a hex needs to be removed from the h3dex, it may also require rebuilding the targeting lookup for h3dex-based targeting if the parent hex (at the targeting resolution) becomes empty as well. However, due to a bug, this check may not be working as expect leaving the hex in the h3dex. The current code is checking for the count of gateways in the parent hex before removing the gateway from that hex. Instead, it should remove the gateway's hex and then check if that results in the parent hex now being empty.
This change is behind a chain var as to to allow it to be made after h3dex activation.