Skip to content

Commit

Permalink
changes 20240718
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilDragonfiend committed Jul 18, 2024
1 parent 316237d commit 7c2ef9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions code/game/machinery/computer/camera_advanced.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
eyeobj.invisibility = INVISIBILITY_ABSTRACT
if(current_user && eyeobj) // indent is correct: transfer ghosts when nobody uses
eyeobj.return_observers() // send ghosts back to their original orbit
eyeobj.transfer_observers_to(user) // if a ghost started observing an eye at first, the return proc won't work.
eyeobj.transfer_observers_to(current_user) // if a ghost started observing an eye at first, the return proc won't work.

/obj/machinery/computer/camera_advanced/proc/GrantActions(mob/living/user)
if(off_action)
Expand All @@ -111,7 +111,7 @@
actions += move_down_action

/obj/machinery/proc/remove_eye_control(mob/living/user)
SIGNAL_HANDLER
SIGNAL_HANDLER // this should be stated at parent
CRASH("[type] does not implement ai eye handling")

/obj/machinery/computer/camera_advanced/remove_eye_control(mob/living/user)
Expand Down
14 changes: 8 additions & 6 deletions code/modules/mob/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Run when a client is put in this mob or reconnets to byond and their client was on this mob
*
* Things it does:
* * call set_eye() to manually manage atom/list/eye_users
* * Adds player to player_list
* * sets lastKnownIP
* * sets computer_id
* * call set_eye() to manually manage atom/list/eye_users
* * logs the login
* * tells the world to update it's status (for player count)
* * create mob huds for the mob if needed
Expand All @@ -24,18 +24,20 @@
* * attaches the ash listener element so clients can hear weather
*/
/mob/Login()
// set_eye() is important here, because your eye doesn't know if you're using them as your eye
// FALSE when weakref doesn't exist, to prevent using their current eye
if(!real_eye)
reset_perspective()
client.set_eye(real_eye, client.eye_weakref?.resolve() || CLIENT_OLD_EYE_NULL)
add_to_player_list()
lastKnownIP = client.address
computer_id = client.computer_id
log_access("Mob Login: [key_name(src)] was assigned to a [type]")
world.update_status()

// eye, hud, images
client.screen = list() //remove hud items just in case
client.images = list()
// set_eye() is important here, because your eye doesn't know if you're using them as your eye
// FALSE when weakref doesn't exist, to prevent using their current eye
if(!real_eye)
reset_perspective()
client.set_eye(real_eye, client.eye_weakref?.resolve() || CLIENT_OLD_EYE_NULL)

if(!hud_used)
create_mob_hud()
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@

// Do not port TG version.
/mob/proc/reset_perspective(atom/new_eye)
// somewhat tricky. If no client ever used this mob as their eye, this proc is not necessary.
// This is necessary because we don't want N number of mobs having 'eye_mobs = list(src)'. not necessary.
if(isnull(lastKnownIP))
return

if(client && client.perspective != EYE_PERSPECTIVE)
stack_trace("something changed client's eye perspective. Current: [client.perspective]")
client.perspective = EYE_PERSPECTIVE
Expand Down

0 comments on commit 7c2ef9d

Please sign in to comment.