mrSkortch / MissionScriptingTools

Mission Scripting Tools for Digital Combat Simulator
GNU General Public License v3.0
195 stars 42 forks source link

On 4_5_126 : Wrong zone coordinates.Point for zone linked to unit #102

Open FullGas1 opened 3 weeks ago

FullGas1 commented 3 weeks ago

The mist.getUnitsInZones function does not seem to work when applied to a zone linked to a unit.

This is because this function retrieves the coordinates of the zone in mist.DBs.zonesByName or mist.DBs.zonesByNum. Unfortunately, in this tables the coordinates of the linked zones are the offset and not the real coordinates of the zone. Furthermore, these tables do not take into account the movements of the zone that has become mobile due to its link.

For everything to work, it would be necessary either: 1> that the real coordinates of the zone (= coordinates of the reference unit + offset) are present in the zone tables, and plan an update of the coordinates of these tables to take into account their possible movement.

2> that the functions that need the coordinates of a linked zone use trigger.misc.getZone() which returns the real coordinates of a mobile zone even when it follows a moving unit.

3> find another better solution ?

Thank you in advance for seeing what can be done about this. Best regards