Odd(?) cast in ParcelManager/GetParcelLocalID
Status: Alpha
Brought to you by:
fredmartian
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);
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)
Right, modify the Logger line too below that :P
fixed in repository: r1022