When assigning client.eye to a turf that is too far from client.mob, the player's view goes black.
It doesn't seem to matter what the z value is, it happens whether the mob and eye are on the same z or not.
Numbered Steps to Reproduce Problem:
1. Create a map and place the starting player's mob in it.
2. Separate the client.eye and client.mob by assigning client.eye to a turf. (I haven't tried assigning client.eye to anything besides a turf.)
3. Move the eye or mob far enough apart from each other, and the screen will go black.
There is a pattern to how far apart they must be before it goes black.
It happens when the horizontal or vertical distance from client.mob to client.eye is greater than 5 + 2 * client.view or when the horizontal and vertical distance are equal to that value. All other values within that square of tiles have no issues.
Code Snippet (if applicable) to Reproduce Problem:
// The following bug occurs in version 467 all the way back to 457
view = 5
blind = FALSE
. = ..()
eye = mob.loc
new_eye = eye
// depending on who-knows-what, between different compilations,
// one of the following will work to recreate the bug:
if (world.map_format == ISOMETRIC_MAP)
range = view * 2 + 5
range = view * 2 + 9
else if (world.map_format == TOPDOWN_MAP)
range = view + 2
. = ..()
var/xdist = abs(L.x - new_eye.x)
var/ydist = abs(L.y - new_eye.y)
//world << "[xdist], [ydist]"
if (!blind &&\
(xdist > range || ydist > range || (ydist == range && xdist == range)))
blind = TRUE
src << "You are now blind."
else if (blind &&\
!(xdist > range || ydist > range || (ydist == range && xdist == range)))
blind = FALSE
src << "You are no longer blind."
Here is a test project that recreates the bug.
Being able to move the client.eye as far from the client.mob as I want in order to provide whatever view to the player that I desire.
The view goes black when the mob reaches a certain distance based upon the client.view.
Does the problem occur:
Every time? Or how often? Every time.
In other games? Only tested it with two.
In other user accounts? Not sure.
On other computers? Not sure.
When does the problem NOT occur?
When you don't move the client.eye too far from the client.mob.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
I've tested in version 457, and the bug is still there.
Set client.perspective to EYE_PERSPECTIVE when client.eye is different than client.mob.