VedalAI / neuro-amongus

Among Us Plugin for Neuro-sama
GNU General Public License v3.0
540 stars 49 forks source link

Replaced GetLocationFromPosition() with a universal implementation #7

Closed tokidokitoky closed 1 year ago

tokidokitoky commented 1 year ago

This PR replaces GetLocationFromPosition() with a generic version that will work on any map, using the game's internal list of rooms and their boundaries to determine the room a co-ordinate is in (or the nearest room, if they're not in one of the rooms).

Because it uses the actual boundaries of the rooms, it should also be more accurate than the original implementation. If a player is not in a room, but in a hallway, it will return "a hallway near Electrical", for example. On Polus, "outside near Electrical", etc. is also used.

This partially addresses Issue #6.

Vedal987 commented 1 year ago

LGTM!