mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Allow click-dragging things into rechargers (#6749)
This commit is contained in:
@@ -31,12 +31,9 @@
|
|||||||
if(C) // Sometimes we get things without cells in it.
|
if(C) // Sometimes we get things without cells in it.
|
||||||
. += "Current charge: [C.charge] / [C.maxcharge]"
|
. += "Current charge: [C.charge] / [C.maxcharge]"
|
||||||
|
|
||||||
/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
|
//CHOMPEdit Start - Let borgs clickdrag things into chargers
|
||||||
var/allowed = 0
|
/obj/machinery/recharger/proc/do_allowed_checks(obj/item/G, mob/user)
|
||||||
for (var/allowed_type in allowed_devices)
|
. = FALSE
|
||||||
if(istype(G, allowed_type)) allowed = 1
|
|
||||||
|
|
||||||
if(allowed)
|
|
||||||
if(charging)
|
if(charging)
|
||||||
to_chat(user, "<span class='warning'>\A [charging] is already charging here.</span>")
|
to_chat(user, "<span class='warning'>\A [charging] is already charging here.</span>")
|
||||||
return
|
return
|
||||||
@@ -95,6 +92,33 @@
|
|||||||
else
|
else
|
||||||
to_chat(user, "<span class='warning'>\The [ourcard] doesn't have a personality!</span>")
|
to_chat(user, "<span class='warning'>\The [ourcard] doesn't have a personality!</span>")
|
||||||
return
|
return
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
/obj/machinery/recharger/MouseDrop_T(obj/item/weapon/G as obj, mob/user as mob)
|
||||||
|
var/allowed = 0
|
||||||
|
for (var/allowed_type in allowed_devices)
|
||||||
|
if(istype(G, allowed_type)) allowed = 1
|
||||||
|
|
||||||
|
if(allowed)
|
||||||
|
if(!do_allowed_checks(G, user))
|
||||||
|
return
|
||||||
|
|
||||||
|
G.loc = src
|
||||||
|
charging = G
|
||||||
|
update_icon()
|
||||||
|
user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].")
|
||||||
|
//CHOMPEdit End
|
||||||
|
|
||||||
|
/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
|
||||||
|
var/allowed = 0
|
||||||
|
for (var/allowed_type in allowed_devices)
|
||||||
|
if(istype(G, allowed_type)) allowed = 1
|
||||||
|
|
||||||
|
if(allowed)
|
||||||
|
//CHOMPEdit Start - move checks into their own proc
|
||||||
|
if(!do_allowed_checks(G, user))
|
||||||
|
return
|
||||||
|
//CHOMPEdit End
|
||||||
|
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
G.loc = src
|
G.loc = src
|
||||||
|
|||||||
@@ -311,14 +311,16 @@
|
|||||||
if(!canremove)
|
if(!canremove)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist
|
//CHOMPEdit start - move these around so that nonhumans can actually click-drag guns at all
|
||||||
|
|
||||||
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech. why?
|
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech. why?
|
||||||
return
|
return
|
||||||
|
|
||||||
if (!( istype(over_object, /obj/screen) ))
|
if (!( istype(over_object, /obj/screen) ))
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
if (ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist
|
||||||
|
//CHOMPEdit End
|
||||||
|
|
||||||
//makes sure that the thing is equipped, so that we can't drag it into our hand from miles away.
|
//makes sure that the thing is equipped, so that we can't drag it into our hand from miles away.
|
||||||
//there's got to be a better way of doing this.
|
//there's got to be a better way of doing this.
|
||||||
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
|
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
|
||||||
|
|||||||
Reference in New Issue
Block a user