View Single Post
07/02/23, 06:06 AM   #9
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
You could try using GetUnitRawWorldPosition to determine if the player is inside the bounding box of a base. Unlike regular map or world coordinates it gives you the "real" position inside 3d space of the loaded world data.
The bases are not really behind the doors you see when you enter, but somewhere a bit further away, so it should be possible to find 2 points that surround the base, but won't overlap with the area outside of it.

Then you can just run the check as needed, or if you want to have a callback, you should be able to use EVENT_PLAYER_ACTIVATED for most entrances and for the ones that do not have a loading screen it should be enough to listen to the invulnerability buff being added (I believe it is also added when you leave the base?).
  Reply With Quote