Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int setCameraLocation() {
- if (!Configuration.enableRoofs)
- return plane;
- int j = 3;
- if (yCameraCurve < 310) {
- int k = xCameraPos >> 7;
- int l = yCameraPos >> 7;
- int i1 = localPlayer.x >> 7;
- int j1 = localPlayer.y >> 7;
- if ((tileFlags[plane][k][l] & 4) != 0)
- j = plane;
- int k1;
- if (i1 > k)
- k1 = i1 - k;
- else
- k1 = k - i1;
- int l1;
- if (j1 > l)
- l1 = j1 - l;
- else
- l1 = l - j1;
- if (k1 > l1) {
- int i2 = (l1 * 0x10000) / k1;
- int k2 = 32768;
- while (k != i1) {
- if (k < i1)
- k++;
- else if (k > i1)
- k--;
- if ((tileFlags[plane][k][l] & 4) != 0)
- j = plane;
- k2 += i2;
- if (k2 >= 0x10000) {
- k2 -= 0x10000;
- if (l < j1)
- l++;
- else if (l > j1)
- l--;
- if ((tileFlags[plane][k][l] & 4) != 0)
- j = plane;
- }
- }
- } else {
- int j2 = (k1 * 0x10000) / l1;
- int l2 = 32768;
- while (l != j1) {
- if (l < j1)
- l++;
- else if (l > j1)
- l--;
- if ((tileFlags[plane][k][l] & 4) != 0)
- j = plane;
- l2 += j2;
- if (l2 >= 0x10000) {
- l2 -= 0x10000;
- if (k < i1)
- k++;
- else if (k > i1)
- k--;
- if ((tileFlags[plane][k][l] & 4) != 0)
- j = plane;
- }
- }
- }
- }
- if ((tileFlags[plane][localPlayer.x >> 7][localPlayer.y >> 7] & 4) != 0)
- j = plane;
- return j;
- }
- private int resetCameraHeight() {
- int orientation = getCenterHeight(plane, yCameraPos, xCameraPos);
- if (orientation - zCameraPos < 800
- && (tileFlags[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
- return plane;
- else
- return 3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement