Fix an antipattern when using canUseTopic

remove redundant range checks that are checked in the fixed canUseTopic
This commit is contained in:
oranges
2016-05-22 00:23:47 +00:00
parent a8a86c88ac
commit 947e2c5c19
7 changed files with 9 additions and 19 deletions
@@ -381,10 +381,10 @@
/obj/structure/closet/AltClick(mob/user)
..()
if(!user.canUseTopic(user))
if(!user.canUseTopic(src, be_close=TRUE))
user << "<span class='warning'>You can't do that right now!</span>"
return
if(opened || !secure || !in_range(src, user))
if(opened || !secure)
return
else
togglelock(user)
+1 -3
View File
@@ -124,11 +124,9 @@
/obj/structure/reflector/AltClick(mob/user)
..()
if(!user.canUseTopic(user))
if(!user.canUseTopic(src, be_close=TRUE))
user << "<span class='warning'>You can't do that right now!</span>"
return
if(!in_range(src, user))
return
else
rotate()