Menu

#6 Odd(?) cast in ParcelManager/GetParcelLocalID

v0.7
closed-fixed
None
5
2014-08-18
2013-10-11
Iain Price
No

Line 1952 casts the co-ordinates to a byte then divides by 4, this results in some oftentimes negative indexes and array out of bounds exceptions result.

I assume the byte cast is intended to clamp the value to 0-256 range, but I forewent that and just replaced the line with some overbracketed casts:

public final int GetParcelLocalID(Simulator simulator, Vector3 position)
{
    int value = simulator.getParcelMap(((int)position.Y) / 4, ((int)position.X) / 4);

Discussion

  • Iain Price

    Iain Price - 2013-10-11

    Actually right now I'm not sure this is the fix, I got another error with a -ve co-ordinate in it now (but at least its not like -1300)

     
  • Iain Price

    Iain Price - 2013-10-11

    Right, modify the Logger line too below that :P

     
  •  Frederick Martian

    • status: open --> closed-fixed
    • assigned_to: Frederick Martian
     
  •  Frederick Martian

    fixed in repository: r1022

     

Log in to post a comment.

MongoDB Logo MongoDB