Skip to content

five-on-it / packages/world/src/scents / nearestScent

Function: nearestScent() ​

nearestScent(level, x, z, reach, accept?): Scent | undefined

Defined in: packages/world/src/scents.ts:71

The scent nearest (x, z) within reach metres (at most SCENT_CELL) that accept takes (any, without it); the first in placement order of two as near; undefined with none.

Parameters ​

level ​

LevelData

x ​

number

z ​

number

reach ​

number

accept? ​

(scent) => boolean

Returns ​

Scent | undefined