From e22360a9a1ea8827c71530a5fae115831492c5be Mon Sep 17 00:00:00 2001 From: LordMidas <55047920+LordMidas@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:48:38 -0400 Subject: [PATCH] feat: add tile validation to the new functions --- .../entity/tactical/tactical_entity_manager.nut | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/msu/hooks/entity/tactical/tactical_entity_manager.nut b/msu/hooks/entity/tactical/tactical_entity_manager.nut index 20cf2c9d9..a9488e4d0 100644 --- a/msu/hooks/entity/tactical/tactical_entity_manager.nut +++ b/msu/hooks/entity/tactical/tactical_entity_manager.nut @@ -35,6 +35,12 @@ q.getActorsWithinRange <- function( _tile, _max = 1, _min = 1 ) { + if (_tile.ID == 0) + { + ::logError("The ID of _tile is 0 which means that the actor this tile was fetched from is not placed on map."); + throw ::MSU.Exception.InvalidValue(_tile); + } + if (_max < _min) { ::logError("_max must be equal to or greater than _min"); @@ -59,6 +65,12 @@ q.getAdjacentActors <- function( _tile ) { + if (_tile.ID == 0) + { + ::logError("The ID of _tile is 0 which means that the actor this tile was fetched from is not placed on map."); + throw ::MSU.Exception.InvalidValue(_tile); + } + local ret = []; for (local i = 0; i < 6; i++) {