mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
Replaces some dumb usage of switch with simpler statements (#48138)
This commit is contained in:
@@ -128,25 +128,14 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/fence/door/proc/toggle(mob/user)
|
||||
switch(open)
|
||||
if(FALSE)
|
||||
visible_message("<span class='notice'>\The [user] opens \the [src].</span>")
|
||||
open = TRUE
|
||||
if(TRUE)
|
||||
visible_message("<span class='notice'>\The [user] closes \the [src].</span>")
|
||||
open = FALSE
|
||||
|
||||
open = !open
|
||||
visible_message("<span class='notice'>\The [user] [open ? "opens" : "closes"] \the [src].</span>")
|
||||
update_door_status()
|
||||
playsound(src, 'sound/machines/click.ogg', 100, TRUE)
|
||||
|
||||
/obj/structure/fence/door/proc/update_door_status()
|
||||
switch(open)
|
||||
if(FALSE)
|
||||
density = TRUE
|
||||
icon_state = "door_closed"
|
||||
if(TRUE)
|
||||
density = FALSE
|
||||
icon_state = "door_opened"
|
||||
density = !density
|
||||
icon_state = density ? "door_closed" : "door_opened"
|
||||
|
||||
/obj/structure/fence/door/proc/can_open(mob/user)
|
||||
return TRUE
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
if(check_botched(user))
|
||||
return
|
||||
|
||||
var/obj/item/bodypart/other_hand = user.has_hand_for_held_index(user.get_inactive_hand_index()) //returns non-disabled inactive hands
|
||||
var/obj/item/bodypart/other_hand = user.has_hand_for_held_index(user.get_inactive_hand_index()) //returns non-disabled inactive hands
|
||||
if(weapon_weight == WEAPON_HEAVY && (user.get_inactive_held_item() || !other_hand))
|
||||
to_chat(user, "<span class='warning'>You need two hands to fire \the [src]!</span>")
|
||||
return
|
||||
@@ -593,13 +593,10 @@
|
||||
if(!user || !user.client)
|
||||
return
|
||||
|
||||
switch(forced_zoom)
|
||||
if(FALSE)
|
||||
zoomed = FALSE
|
||||
if(TRUE)
|
||||
zoomed = TRUE
|
||||
else
|
||||
zoomed = !zoomed
|
||||
if(isnull(forced_zoom))
|
||||
zoomed = !zoomed
|
||||
else
|
||||
zoomed = forced_zoom
|
||||
|
||||
if(zoomed)
|
||||
var/_x = 0
|
||||
|
||||
Reference in New Issue
Block a user