IsWorldCellPassable
Checks whether it is possible to walk from the current cell to the destination cell, taking into account terrain, statics, and dynamic objects.
CurrX, CurrY, CurrZ — current position coordinates.
DestX, DestY — destination cell coordinates.
DestZ (Pascal) — var parameter; on return, contains the calculated Z coordinate at the destination cell.
WorldNum — map (facet) number.
Pascal: Returns True if the cell is passable. The DestZ parameter is updated with the destination Z level.
Python: Returns a tuple (passable: bool, dest_z: int) — the passability flag and the calculated destination Z.
Returns False if the character is disconnected or map data is not loaded.
Проверяет, можно ли пройти из текущей ячейки в целевую, учитывая рельеф, статику и динамические объекты.
CurrX, CurrY, CurrZ — координаты текущей позиции.
DestX, DestY — координаты целевой ячейки.
DestZ (Pascal) — параметр var; при возврате содержит рассчитанную Z-координату целевой ячейки.
WorldNum — номер карты (фасета).
Pascal: Возвращает True, если ячейка проходима. Параметр DestZ обновляется значением Z на целевой позиции.
Python: Возвращает кортеж (passable: bool, dest_z: int) — флаг проходимости и рассчитанную Z-координату.
Возвращает False, если персонаж не подключён или данные карты не загружены.
function IsWorldCellPassable(CurrX: Word; CurrY: Word; CurrZ: ShortInt;
DestX: Word; DestY: Word; var DestZ: ShortInt; WorldNum: Byte): Boolean;
def IsWorldCellPassable(CurrX: int, CurrY: int, CurrZ: int,
DestX: int, DestY: int, WorldNum: int) -> tuple[bool, int]: ...
var
DZ: ShortInt;
begin
DZ := 0;
if IsWorldCellPassable(GetX(Self), GetY(Self), GetZ(Self),
GetX(Self) + 1, GetY(Self), DZ, WorldNum) then
AddToSystemJournal('East cell is passable, Z=' + IntToStr(DZ))
else
AddToSystemJournal('East cell is blocked');
end.
passable, dest_z = IsWorldCellPassable(
GetX(Self()), GetY(Self()), GetZ(Self()),
GetX(Self()) + 1, GetY(Self()), WorldNum())
if passable:
AddToSystemJournal(f'East cell is passable, Z={dest_z}')
else:
AddToSystemJournal('East cell is blocked')