User Tools

Site Tools


4rpl:commands:ufc

Index
Math Utility

UFC

UFC(<-cell) ->cellZ ->cellX

Description

Takes a flattened map cell and returns the map cell coordinates. The flat cell location is equal to: cellX + cellZ * MAP_WIDTH. This routine reverse this. Note: THe X and Z coordinates will be clipped to the map bounds. So values less than 0 are permuted to 0, x is limited to MAP_WIDTH-1, etc.

See FC for the reverse calculation.

Examples

FC(GetRandMapCell) ->C
UFC(<-C) ->cellZ ->cellX

Index

4rpl/commands/ufc.txt · Last modified: 2022/09/04 09:29 by Karsten75