[s] Fixes altclick exploits

This commit is contained in:
ShizCalev
2018-02-10 22:06:12 -05:00
committed by CitadelStationBot
parent 7f7bea7468
commit f4685cfe01
60 changed files with 660 additions and 129 deletions
+1 -1
View File
@@ -78,7 +78,7 @@
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
if(isnull(requested_amount) || (requested_amount <= 0))
return
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || !user.canUseTopic(current_parent) || !user.is_holding(I) || !user.Adjacent(current_parent))
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || !user.canUseTopic(current_parent, BE_CLOSE) || !user.is_holding(I))
return
if(!user.temporarilyRemoveItemFromInventory(I))
to_chat(user, "<span class='warning'>[I] is stuck to you and cannot be placed into [parent].</span>")
+4 -4
View File
@@ -12,11 +12,11 @@
var/rotation_flags = NONE
var/default_rotation_direction = ROTATION_CLOCKWISE
/datum/component/simple_rotation/Initialize(rotation_flags = NONE ,can_user_rotate,can_be_rotated,after_rotation)
if(!ismovableatom(parent))
return COMPONENT_INCOMPATIBLE
//throw if no rotation direction is specificed ?
src.rotation_flags = rotation_flags
@@ -25,7 +25,7 @@
src.can_user_rotate = can_user_rotate
else
src.can_user_rotate = CALLBACK(src,.proc/default_can_user_rotate)
if(can_be_rotated)
src.can_be_rotated = can_be_rotated
else
@@ -89,7 +89,7 @@
after_rotation.Invoke(user,rotation_type)
/datum/component/simple_rotation/proc/default_can_user_rotate(mob/living/user, rotation_type)
if(!istype(user) || !user.Adjacent(parent) || user.incapacitated())
if(!istype(user) || !user.canUseTopic(parent, BE_CLOSE, NO_DEXTERY))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return FALSE
return TRUE