Fixes some dropItemToGround runtimes (#45257)

* Simplified

* unfucked

* Documentation
This commit is contained in:
ShizCalev
2019-07-22 16:44:02 -07:00
committed by Rob Bailey
parent 5f278ad8f6
commit 0ddb4b4d69
+10 -5
View File
@@ -289,12 +289,17 @@
//The following functions are the same save for one small difference
//for when you want the item to end up on the ground
//will force move the item to the ground and call the turf's Entered
/**
* Used to drop an item (if it exists) to the ground.
* * Will pass as TRUE is successfully dropped, or if there is no item to drop.
* * Will pass FALSE if the item can not be dropped due to TRAIT_NODROP via doUnEquip()
* If the item can be dropped, it will be forceMove()'d to the ground and the turf's Entered() will be called.
*/
/mob/proc/dropItemToGround(obj/item/I, force = FALSE)
I.pixel_x = rand(-6,6)
I.pixel_y = rand(-6,6)
return doUnEquip(I, force, drop_location(), FALSE)
. = doUnEquip(I, force, drop_location(), FALSE)
if(. && I) //ensure the item exists and that it was dropped properly.
I.pixel_x = rand(-6,6)
I.pixel_y = rand(-6,6)
//for when the item will be immediately placed in a loc other than the ground
/mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE)