Skip to content

Commit

Permalink
[MIRROR] Fixes a runtime in advanced camera console [MDB IGNORE] (#843)
Browse files Browse the repository at this point in the history
* Fixes a runtime in advanced camera console (#79938)
---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Bloop <[email protected]>
Co-authored-by: SyncIt21 <110812394+SyncIt21@ users.noreply.github.com>
  • Loading branch information
4 people authored Nov 27, 2023
1 parent bedd478 commit 7c89863
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions code/game/machinery/computer/camera_advanced.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,18 @@
CRASH("[type] does not implement ai eye handling")

/obj/machinery/computer/camera_advanced/remove_eye_control(mob/living/user)
if(!user)
if(isnull(user?.client))
return

for(var/datum/action/actions_removed as anything in actions)
actions_removed.Remove(user)
for(var/datum/camerachunk/camerachunks_gone as anything in eyeobj.visibleCameraChunks)
camerachunks_gone.remove(eyeobj)
if(user.client)
user.reset_perspective(null)
if(eyeobj.visible_icon && user.client)
user.client.images -= eyeobj.user_image
user.client.view_size.unsupress()

user.reset_perspective(null)
if(eyeobj.visible_icon)
user.client.images -= eyeobj.user_image
user.client.view_size.unsupress()

eyeobj.eye_user = null
user.remote_control = null
Expand Down Expand Up @@ -121,6 +122,8 @@
return
if(!can_use(user))
return
if(isnull(user.client))
return
if(current_user)
to_chat(user, span_warning("The console is already in use!"))
return
Expand Down Expand Up @@ -165,6 +168,8 @@
return //AIs would need to disable their own camera procs to use the console safely. Bugs happen otherwise.

/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user)
if(isnull(user?.client))
return
GrantActions(user)
current_user = user
eyeobj.eye_user = user
Expand Down

0 comments on commit 7c89863

Please sign in to comment.