Skip to content

Commit

Permalink
feat: add tile validation to the new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LordMidas committed Jun 17, 2024
1 parent bc926a5 commit e22360a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions msu/hooks/entity/tactical/tactical_entity_manager.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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++)
{
Expand Down

0 comments on commit e22360a

Please sign in to comment.