Skip to content

Commit e22360a

Browse files
committed
feat: add tile validation to the new functions
1 parent bc926a5 commit e22360a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

msu/hooks/entity/tactical/tactical_entity_manager.nut

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
q.getActorsWithinRange <- function( _tile, _max = 1, _min = 1 )
3737
{
38+
if (_tile.ID == 0)
39+
{
40+
::logError("The ID of _tile is 0 which means that the actor this tile was fetched from is not placed on map.");
41+
throw ::MSU.Exception.InvalidValue(_tile);
42+
}
43+
3844
if (_max < _min)
3945
{
4046
::logError("_max must be equal to or greater than _min");
@@ -59,6 +65,12 @@
5965

6066
q.getAdjacentActors <- function( _tile )
6167
{
68+
if (_tile.ID == 0)
69+
{
70+
::logError("The ID of _tile is 0 which means that the actor this tile was fetched from is not placed on map.");
71+
throw ::MSU.Exception.InvalidValue(_tile);
72+
}
73+
6274
local ret = [];
6375
for (local i = 0; i < 6; i++)
6476
{

0 commit comments

Comments
 (0)