Updatesector: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
'''updatesector''' <in_x> <in_y> <in_out_sectnum><br> | '''updatesector''' <in_x> <in_y> <in_out_sectnum><br> | ||
'''updatesectorz''' <in_x> <in_y> <in_z> <in_out_sectnum> | '''updatesectorz''' <in_x> <in_y> <in_z> <in_out_sectnum><br> | ||
'''updatesectorneighbour''' <in_x> <in_y> <in_out_sectnum> <initial distance> <max distance> | '''updatesectorneighbour''' <in_x> <in_y> <in_out_sectnum> <initial distance> <max distance><br> | ||
'''updatesectorneighbourz''' <in_x> <in_y> <in_z> <in_out_sectnum> <initial distance> <max distance> | '''updatesectorneighbourz''' <in_x> <in_y> <in_z> <in_out_sectnum> <initial distance> <max distance> | ||
Latest revision as of 15:52, 5 July 2025
updatesector <in_x> <in_y> <in_out_sectnum>
updatesectorz <in_x> <in_y> <in_z> <in_out_sectnum>
updatesectorneighbour <in_x> <in_y> <in_out_sectnum> <initial distance> <max distance>
updatesectorneighbourz <in_x> <in_y> <in_z> <in_out_sectnum> <initial distance> <max distance>
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.
The "neighbour" counterparts are more performant for tasks that require determining whether nearby sectors exist at a point as they will not exhaustively search the map and has been added in since r7805