Updatesector

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

updatesector <in_x> <in_y> <in_out_sectnum>
updatesectorz <in_x> <in_y> <in_z> <in_out_sectnum>

Returns sector id of the sector containing the point (<in_x>,<in_y>) or (<in_x>,<in_y>,<in_z>) into <in_out_sectnum>. The final parameter must be pre-populated with what is assumed to be the correct sector, such as the sprite's pre-existing sectnum.

If the point is not a valid sector (like outside the map, inside a column, or below the floor), it returns -1. You should verify that the value return is not equal to -1 before manipulating the sector or you could have problems.