|
91 | 91 |
|
92 | 92 | /datum/component/shell/proc/on_object_deconstruct()
|
93 | 93 | SIGNAL_HANDLER
|
94 |
| - if(!attached_circuit.admin_only) |
| 94 | + if(!attached_circuit?.admin_only) |
95 | 95 | remove_circuit()
|
96 | 96 |
|
97 | 97 | /datum/component/shell/proc/on_attack_ghost(datum/source, mob/dead/observer/ghost)
|
98 | 98 | SIGNAL_HANDLER
|
| 99 | + if(!is_authorized(ghost)) |
| 100 | + return |
| 101 | + |
99 | 102 | if(attached_circuit)
|
100 | 103 | INVOKE_ASYNC(attached_circuit, /datum.proc/ui_interact, ghost)
|
101 | 104 |
|
102 | 105 | /datum/component/shell/proc/on_examine(datum/source, mob/user, list/examine_text)
|
103 | 106 | SIGNAL_HANDLER
|
| 107 | + if(!is_authorized(user)) |
| 108 | + return |
| 109 | + |
104 | 110 | if(!attached_circuit)
|
105 | 111 | examine_text += span_notice("There is no integrated circuit attached.")
|
106 | 112 | return
|
|
127 | 133 | */
|
128 | 134 | /datum/component/shell/proc/on_attack_by(atom/source, obj/item/item, mob/living/attacker)
|
129 | 135 | SIGNAL_HANDLER
|
| 136 | + if(!is_authorized(attacker)) |
| 137 | + return |
| 138 | + |
130 | 139 | if(istype(item, /obj/item/stock_parts/cell))
|
131 | 140 | source.balloon_alert(attacker, "can't put cell in directly!")
|
132 | 141 | return
|
|
178 | 187 |
|
179 | 188 | /datum/component/shell/proc/on_multitool_act(atom/source, mob/user, obj/item/tool)
|
180 | 189 | SIGNAL_HANDLER
|
| 190 | + if(!is_authorized(user)) |
| 191 | + return |
| 192 | + |
181 | 193 | if(!attached_circuit)
|
182 | 194 | return
|
183 | 195 |
|
|
195 | 207 | */
|
196 | 208 | /datum/component/shell/proc/on_screwdriver_act(atom/source, mob/user, obj/item/tool)
|
197 | 209 | SIGNAL_HANDLER
|
| 210 | + if(!is_authorized(user)) |
| 211 | + return |
| 212 | + |
198 | 213 | if(!attached_circuit)
|
199 | 214 | return
|
200 | 215 |
|
|
283 | 298 |
|
284 | 299 | /datum/component/shell/proc/on_atom_usb_cable_try_attach(atom/source, obj/item/usb_cable/usb_cable, mob/user)
|
285 | 300 | SIGNAL_HANDLER
|
| 301 | + if(!is_authorized(user)) |
| 302 | + return |
286 | 303 |
|
287 | 304 | if (!(shell_flags & SHELL_FLAG_USB_PORT))
|
288 | 305 | source.balloon_alert(user, "this shell has no usb ports")
|
|
294 | 311 |
|
295 | 312 | usb_cable.attached_circuit = attached_circuit
|
296 | 313 | return COMSIG_USB_CABLE_CONNECTED_TO_CIRCUIT
|
| 314 | + |
| 315 | +/** |
| 316 | + * Determines if a user is authorized to see the existance of this shell. Returns false if they are not |
| 317 | + * |
| 318 | + * Arguments: |
| 319 | + * * user - The user to check if they are authorized |
| 320 | + */ |
| 321 | +/datum/component/shell/proc/is_authorized(mob/user) |
| 322 | + if(shell_flags & SHELL_FLAG_CIRCUIT_FIXED) |
| 323 | + return FALSE |
| 324 | + |
| 325 | + if(attached_circuit?.admin_only) |
| 326 | + if(check_rights_for(user.client, R_VAREDIT)) |
| 327 | + return TRUE |
| 328 | + return FALSE |
| 329 | + |
| 330 | + return TRUE |
0 commit comments