Fixes mining borg ore box movement on sand with a mining satchel equipped (#6693)

This commit is contained in:
Atermonera
2020-02-16 22:17:19 -08:00
committed by GitHub
parent c9f8ea6a6c
commit a862d55fe6
5 changed files with 68 additions and 83 deletions
-9
View File
@@ -124,15 +124,6 @@ turf/simulated/mineral/floor/light_corner
if(air_master)
air_master.mark_for_update(src)
/turf/simulated/mineral/Entered(atom/movable/M as mob|obj)
. = ..()
if(istype(M,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = M
if(R.module)
for(var/obj/item/weapon/storage/bag/ore/O in list(R.module_state_1, R.module_state_2, R.module_state_3))
attackby(O, R)
return
/turf/simulated/mineral/proc/get_cached_border(var/cache_id, var/direction, var/icon_file, var/icon_state, var/offset = 32)
//Cache miss
if(!mining_overlay_cache["[cache_id]_[direction]"])
@@ -1,6 +1,5 @@
/**********************Ore box**************************/
//Why the hell is this file called satchel_ore_boxdm.dm? -CK
/obj/structure/ore_box
icon = 'icons/obj/mining.dmi'
icon_state = "orebox0"
@@ -40,12 +39,8 @@
stored_ore[O.name] = 1
/obj/structure/ore_box/examine(mob/user)
user << "That's an [src]."
user << desc
// Borgs can now check contents too.
if((!istype(user, /mob/living/carbon/human)) && (!istype(user, /mob/living/silicon/robot)))
return
to_chat(user, "That's an [src].")
to_chat(user, desc)
if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them.
return
@@ -53,16 +48,16 @@
add_fingerprint(user)
if(!contents.len)
user << "It is empty."
to_chat(user, "It is empty.")
return
if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
user << "It holds:"
to_chat(user, "It holds:")
for(var/ore in stored_ore)
user << "- [stored_ore[ore]] [ore]"
to_chat(user, "- [stored_ore[ore]] [ore]")
return
/obj/structure/ore_box/verb/empty_box()
@@ -70,27 +65,27 @@
set category = "Object"
set src in view(1)
if(!istype(usr, /mob/living/carbon/human) && !istype(usr, /mob/living/silicon/robot)) //Only living, intelligent creatures with gripping aparatti can empty ore boxes.
usr << "<font color='red'>You are physically incapable of emptying the ore box.</font>"
if(!ishuman(usr) && !isrobot(usr)) //Only living, intelligent creatures with gripping aparatti can empty ore boxes.
to_chat(usr, "<span class='warning'>You are physically incapable of emptying the ore box.</span>")
return
if( usr.stat || usr.restrained() )
if(usr.stat || usr.restrained())
return
if(!Adjacent(usr)) //You can only empty the box if you can physically reach it
usr << "You cannot reach the ore box."
to_chat(usr, "You cannot reach the ore box.")
return
add_fingerprint(usr)
if(contents.len < 1)
usr << "<font color='red'>The ore box is empty.</font>"
to_chat(usr, "<span class='warning'>The ore box is empty.</span>")
return
for (var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
usr << "<font color='blue'>You empty the ore box.</font>"
to_chat(usr, "<span class='notice'>You empty the ore box.</span>")
return