From a50ca185a1c5c31c5fab5d9f1153815f7611c166 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Fri, 6 Oct 2017 02:29:53 -0400 Subject: [PATCH 01/24] Fixes cool threads grammar issue --- code/modules/clothing/clothing.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 237714eb8ec..985db1947e3 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -144,15 +144,15 @@ if(pockets) var/list/how_cool_are_your_threads = list("") if(pockets.priority) - how_cool_are_your_threads += "Your [src]'s storage opens when clicked.\n" + how_cool_are_your_threads += "[src]'s storage opens when clicked.\n" else - how_cool_are_your_threads += "Your [src]'s storage opens when dragged to yourself.\n" - how_cool_are_your_threads += "Your [src] can store [pockets.storage_slots] item[pockets.storage_slots > 1 ? "s" : ""].\n" - how_cool_are_your_threads += "Your [src] can store items that are [weightclass2text(pockets.max_w_class)] or smaller.\n" + how_cool_are_your_threads += "[src]'s storage opens when dragged to yourself.\n" + how_cool_are_your_threads += "[src] can store [pockets.storage_slots] item[pockets.storage_slots > 1 ? "s" : ""].\n" + how_cool_are_your_threads += "[src] can store items that are [weightclass2text(pockets.max_w_class)] or smaller.\n" if(pockets.quickdraw) - how_cool_are_your_threads += "You can quickly remove an item from your [src] using Alt-Click.\n" + how_cool_are_your_threads += "You can quickly remove an item from [src] using Alt-Click.\n" if(pockets.silent) - how_cool_are_your_threads += "Adding or Removing items from your [src] makes no noise.\n" + how_cool_are_your_threads += "Adding or removing items from [src] makes no noise.\n" how_cool_are_your_threads += "" to_chat(user, how_cool_are_your_threads.Join()) From 7b7a4ca287d07ba53fb82cb0f01f5ac762d51db6 Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Fri, 6 Oct 2017 00:29:04 -0700 Subject: [PATCH 02/24] High pop reduced MC processing mode. The logic behind this is that at higher populations, byond ends up needing to do more at the end of the tick to update clients, that the mc and traditional sleep timers end up fighting for a very small amount of time left. Increasing the MC's sleep time means its wakes up sooner in the tick. So it has more time to do things, even if they don't happen as often, and leaving every other tick free allows for sleeping CHECK_TICK task to wake up without finding the MC left them very little time to do things. Admins have been regularly manually doing this by varediting the processing variable to 2, that i figured we should automate it. for /tg/, i plan on raising the player count a bit, but they make decent defaults for the avg server. --- code/__DEFINES/configuration.dm | 1 + .../configuration/entries/config.dm | 25 ++++++++++++++++- code/controllers/master.dm | 10 +++++++ code/modules/client/client_procs.dm | 3 ++ config/config.txt | 28 +++++++++++++++++-- 5 files changed, 64 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/configuration.dm b/code/__DEFINES/configuration.dm index c78dfb28ab2..3db0ca24c2c 100644 --- a/code/__DEFINES/configuration.dm +++ b/code/__DEFINES/configuration.dm @@ -2,6 +2,7 @@ #define CONFIG_DEF(X) /datum/config_entry/##X { resident_file = CURRENT_RESIDENT_FILE }; /datum/config_entry/##X #define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X) #define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y) +#define CONFIG_TWEAK(X) /datum/config_entry/##X #define CONFIG_MAPS_FILE "maps.txt" diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm index dda8fd9a3ce..e7cb363e553 100644 --- a/code/controllers/configuration/entries/config.dm +++ b/code/controllers/configuration/entries/config.dm @@ -348,4 +348,27 @@ CONFIG_DEF(number/error_msg_delay) // How long to wait between messaging admins CONFIG_DEF(flag/irc_announce_new_game) -CONFIG_DEF(flag/debug_admin_hrefs) \ No newline at end of file +CONFIG_DEF(flag/debug_admin_hrefs) + + +CONFIG_DEF(number/mc_tick_rate/base_mc_tick_rate) + integer = FALSE + value = 1 + +CONFIG_DEF(number/mc_tick_rate/high_pop_mc_tick_rate) + integer = FALSE + value = 1.1 + +CONFIG_DEF(number/mc_tick_rate/high_pop_mc_mode_amount) + value = 65 + +CONFIG_DEF(number/mc_tick_rate/disable_high_pop_mc_mode_amount) + value = 60 + +CONFIG_TWEAK(number/mc_tick_rate) + abstract_type = /datum/config_entry/number/mc_tick_rate + +CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val)) + . = ..() + if (. && Master) + Master.UpdateTickRate() diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 6ed3121179d..b92853a2c47 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -573,3 +573,13 @@ GLOBAL_REAL(Master, /datum/controller/master) = new for(var/S in subsystems) var/datum/controller/subsystem/SS = S SS.StopLoadingMap() + + +/datum/controller/master/proc/UpdateTickRate() + if (!processing) + return + var/client_count = length(GLOB.clients) + if (client_count < CONFIG_GET(number/mc_tick_rate/disable_high_pop_mc_mode_amount)) + processing = CONFIG_GET(number/mc_tick_rate/base_mc_tick_rate) + else if (client_count > CONFIG_GET(number/mc_tick_rate/high_pop_mc_mode_amount)) + processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate) \ No newline at end of file diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 7699c9cd5f8..886477fa965 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -350,6 +350,8 @@ GLOBAL_LIST(external_rsc_urls) if (menuitem) menuitem.Load_checked(src) + Master.UpdateTickRate() + ////////////// //DISCONNECT// ////////////// @@ -386,6 +388,7 @@ GLOBAL_LIST(external_rsc_urls) if(movingmob != null) movingmob.client_mobs_in_contents -= mob UNSETEMPTY(movingmob.client_mobs_in_contents) + Master.UpdateTickRate() return ..() /client/Destroy() diff --git a/config/config.txt b/config/config.txt index 1602cd4f48d..61a5b1c9d4c 100644 --- a/config/config.txt +++ b/config/config.txt @@ -232,9 +232,13 @@ ALLOW_HOLIDAYS ##This is currently a testing optimized setting. A good value for production would be 98. TICK_LIMIT_MC_INIT 500 -##Defines the ticklag for the world. 0.9 is the normal one, 0.5 is smoother. +##Defines the ticklag for the world. Ticklag is the amount of time between game ticks (aka byond ticks) (in 1/10ths of a second). +## This also controls the client network update rate, as well as the default client fps TICKLAG 0.5 +##Can also be set as per-second value, the follow value is identical to the above. +#FPS 20 + ## Comment this out to disable automuting #AUTOMUTE_ON @@ -360,4 +364,24 @@ MINUTE_TOPIC_LIMIT 100 #IRC_ANNOUNCE_NEW_GAME ## Allow admin hrefs that don't use the new token system, will eventually be removed -DEBUG_ADMIN_HREFS \ No newline at end of file +DEBUG_ADMIN_HREFS + +###Master Controller High Pop Mode### + +##The Master Controller(MC) is the primary system controlling timed tasks and events in SS13 (lobby timer, game checks, lighting updates, atmos, etc) +##Default base MC tick rate (1 = process every "byond tick" (see: tick_lag/fps config settings), 2 = process every 2 byond ticks, etc) +## Setting this to 0 will prevent the Master Controller from ticking +BASE_MC_TICK_RATE 1 + +##High population MC tick rate +## Byond rounds timer values UP, but the tick rate is modified with heuristics during lag spites so setting this to something like 2 +## will make it run every 2 byond ticks, but will also double the effect of anti-lag heuristics. You can instead set it to something like +## 1.1 to make it run every 2 byond ticks, but only increase the effect of anti-lag heuristics by 10%. or 1.5 for 50%. +## (As an aside, you could in theory also reduce the effect of anti-lag heuristics in the base tick rate by setting it to something like 0.5) +HIGH_POP_MC_TICK_RATE 1.1 + +##Engage high pop mode if player count raises above this (Player in this context means any connected user. Lobby, ghost or in-game all count) +HIGH_POP_MC_MODE_AMOUNT 65 + +##Disengage high pop mode if player count drops below this +DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 From 4a02903e58e482edd3d4dcbb9e0ad9ef18fc2446 Mon Sep 17 00:00:00 2001 From: BeeSting12 Date: Fri, 6 Oct 2017 08:34:29 -0400 Subject: [PATCH 03/24] lights to light --- code/game/objects/items/cigs_lighters.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index f04f8d44414..13fe778a38b 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -513,7 +513,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(!lit) set_lit(TRUE) if(fancy) - user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "Without even breaking stride, you flip open and lights [src] in one smooth movement.") + user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "Without even breaking stride, you flip open and light [src] in one smooth movement.") else var/prot = FALSE var/mob/living/carbon/human/H = user From feabd419009329847875355e5fc10f00cf221bac Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Fri, 6 Oct 2017 20:33:42 +0300 Subject: [PATCH 04/24] Always be alert for skeletons --- code/__DEFINES/atmospherics.dm | 10 +++++++- .../game/mecha/equipment/tools/other_tools.dm | 2 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/items/tanks/jetpack.dm | 4 ++-- code/game/objects/items/tanks/tank_types.dm | 16 ++++++------- code/game/turfs/turf.dm | 2 +- code/modules/admin/verbs/debug.dm | 2 +- .../atmospherics/gasmixtures/gas_mixture.dm | 23 +++++-------------- .../atmospherics/gasmixtures/reactions.dm | 8 +++---- .../components/trinary_devices/filter.dm | 3 +-- .../unary_devices/oxygen_generator.dm | 2 +- .../components/unary_devices/tank.dm | 2 +- .../atmospherics/machinery/other/miner.dm | 2 +- 13 files changed, 36 insertions(+), 42 deletions(-) diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index c6ca2cf0ec5..16f8c780408 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -175,4 +175,12 @@ #define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland #define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300" -#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity()) \ No newline at end of file +#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity()) + +//ASSERT_GAS(gas_mixture,gas_id) - used to guarantee that the gas list for this id exists in gas_mixture. +//Must be used before adding to a gas. May be used before reading from a gas. +#define ASSERT_GAS(gas_mixture,gas_id) if (!gas_mixture.gases[gas_id]) { GASLIST(gas_id, gas_mixture.gases[gas_id]) }; + +#define GASLIST(id, out_list)\ + var/list/tmp_gaslist = GLOB.gaslist_cache[id];\ + out_list = tmp_gaslist.Copy(); \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 51e27bebcce..5e89c6552ab 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -430,7 +430,7 @@ if(!istype(T)) return var/datum/gas_mixture/GM = new - GM.assert_gas("plasma") + ASSERT_GAS(GM,"plasma") if(prob(10)) GM.gases["plasma"][MOLES] += 100 GM.temperature = 1500+T0C //should be enough to start a fire diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 3f32b18178c..2636b90f21d 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -169,7 +169,7 @@ qdel(H) var/list/G_gases = G.gases if(G_gases["plasma"]) - G.assert_gas("n2") + ASSERT_GAS(G,"n2") G_gases["n2"][MOLES] += (G_gases["plasma"][MOLES]) G_gases["plasma"][MOLES] = 0 G.garbage_collect() diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index 062ca66ddb1..3c998ca3ccd 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -17,7 +17,7 @@ /obj/item/tank/jetpack/New() ..() if(gas_type) - air_contents.assert_gas(gas_type) + ASSERT_GAS(air_contents,gas_type) air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C) ion_trail = new @@ -193,7 +193,7 @@ //Return a jetpack that the mob can use //Back worn jetpacks, hardsuit internal packs, and so on. -//Used in Process_Spacemove() and wherever you want to check for/get a jetpack +//Used in Process_Spacemove() and wherever you want to check for/get a jetpack /mob/proc/get_jetpack() return diff --git a/code/game/objects/items/tanks/tank_types.dm b/code/game/objects/items/tanks/tank_types.dm index 9892c354457..b4f6393b6bb 100644 --- a/code/game/objects/items/tanks/tank_types.dm +++ b/code/game/objects/items/tanks/tank_types.dm @@ -21,7 +21,7 @@ /obj/item/tank/internals/oxygen/New() ..() - air_contents.assert_gas("o2") + ASSERT_GAS(air_contents, "o2") air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -87,7 +87,7 @@ /obj/item/tank/internals/plasma/New() ..() - air_contents.assert_gas("plasma") + ASSERT_GAS(air_contents,"plasma") air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -106,7 +106,7 @@ /obj/item/tank/internals/plasma/full/New() ..() - air_contents.assert_gas("plasma") + ASSERT_GAS(air_contents,"plasma") air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -125,13 +125,12 @@ /obj/item/tank/internals/plasmaman/New() ..() - air_contents.assert_gas("plasma") + ASSERT_GAS(air_contents,"plasma") air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return /obj/item/tank/internals/plasmaman/full/New() - ..() - air_contents.assert_gas("plasma") + ..() // Plasma asserted in parent air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -145,8 +144,7 @@ w_class = WEIGHT_CLASS_SMALL //thanks i forgot this /obj/item/tank/internals/plasmaman/belt/full/New() - ..() - air_contents.assert_gas("plasma") + ..() // Plasma asserted in parent air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -169,7 +167,7 @@ /obj/item/tank/internals/emergency_oxygen/New() ..() - air_contents.assert_gas("o2") + ASSERT_GAS(air_contents,"o2") air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 15910adf47b..206d53b6d2a 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -290,7 +290,7 @@ continue var/list/S_gases = S.air.gases for(var/id in S_gases) - total.assert_gas(id) + ASSERT_GAS(total, id) total_gases[id][MOLES] += S_gases[id][MOLES] total.temperature += S.air.temperature diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 0cc147324e7..30034a6ac16 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -716,7 +716,7 @@ GLOBAL_PROTECT(LastAdminCalledProc) if(Rad.anchored) if(!Rad.loaded_tank) var/obj/item/tank/internals/plasma/Plasma = new/obj/item/tank/internals/plasma(Rad) - Plasma.air_contents.assert_gas("plasma") + ASSERT_GAS(Plasma.air_contents, "plasma") Plasma.air_contents.gases["plasma"][MOLES] = 70 Rad.drainratio = 0 Rad.loaded_tank = Plasma diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index ac8349f5f7e..4e05d285abd 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -21,10 +21,6 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) cached_gas[ARCHIVE] = 0 cached_gas[GAS_META] = GLOB.meta_gas_info[id] -#define GASLIST(id, out_list)\ - var/list/tmp_gaslist = GLOB.gaslist_cache[id];\ - out_list = tmp_gaslist.Copy(); - /datum/gas_mixture var/list/gases var/temperature //kelvins @@ -43,18 +39,10 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) //listmos procs - //assert_gas(gas_id) - used to guarantee that the gas list for this id exists. - //Must be used before adding to a gas. May be used before reading from a gas. -/datum/gas_mixture/proc/assert_gas(gas_id) - var/cached_gases = gases - if(cached_gases[gas_id]) - return - GASLIST(gas_id, cached_gases[gas_id]) - - //assert_gases(args) - shorthand for calling assert_gas() once for each gas type. + //assert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type. /datum/gas_mixture/proc/assert_gases() for(var/id in args) - assert_gas(id) + ASSERT_GAS(src,id) //add_gas(gas_id) - similar to assert_gas(), but does not check for an existing //gas list for this id. This can clobber existing gases. @@ -80,9 +68,9 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) cached_gases -= id //PV = nRT + /datum/gas_mixture/proc/heat_capacity() //joules per kelvin var/list/cached_gases = gases - . = 0 for(var/id in cached_gases) var/gas_data = cached_gases[id] . += gas_data[MOLES] * gas_data[GAS_META][META_GAS_SPECIFIC_HEAT] @@ -195,7 +183,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) var/list/giver_gases = giver.gases //gas transfer for(var/giver_id in giver_gases) - assert_gas(giver_id) + ASSERT_GAS(src, giver_id) cached_gases[giver_id][MOLES] += giver_gases[giver_id][MOLES] return 1 @@ -250,13 +238,14 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) return copy + /datum/gas_mixture/copy_from(datum/gas_mixture/sample) var/list/cached_gases = gases //accessing datum vars is slower than proc vars var/list/sample_gases = sample.gases temperature = sample.temperature for(var/id in sample_gases) - assert_gas(id) + ASSERT_GAS(src,id) cached_gases[id][MOLES] = sample_gases[id][MOLES] //remove all gases not in the sample diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index abbfcf89242..750132dcd22 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -57,7 +57,7 @@ cached_gases["co2"][MOLES] -= reaction_rate cached_gases["agent_b"][MOLES] -= reaction_rate*0.05 - air.assert_gas("o2") //only need to assert oxygen, as this reaction doesn't occur without the other gases existing + ASSERT_GAS(air, "o2") //only need to assert oxygen, as this reaction doesn't occur without the other gases existing cached_gases["o2"][MOLES] += reaction_rate air.temperature -= (reaction_rate*20000)/air.heat_capacity() @@ -126,7 +126,7 @@ if(burned_fuel) energy_released += FIRE_CARBON_ENERGY_RELEASED * burned_fuel - air.assert_gas("co2") + ASSERT_GAS(air, "co2") cached_gases["co2"][MOLES] += burned_fuel cached_results[id] += burned_fuel @@ -142,14 +142,14 @@ else temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE) if(temperature_scale > 0) - air.assert_gas("o2") + ASSERT_GAS(air, "o2") oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale if(cached_gases["o2"][MOLES] > cached_gases["plasma"][MOLES]*PLASMA_OXYGEN_FULLBURN) plasma_burn_rate = (cached_gases["plasma"][MOLES]*temperature_scale)/PLASMA_BURN_RATE_DELTA else plasma_burn_rate = (temperature_scale*(cached_gases["o2"][MOLES]/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY) - air.assert_gas("co2") + ASSERT_GAS(air, "co2") cached_gases["plasma"][MOLES] = QUANTIZE(cached_gases["plasma"][MOLES] - plasma_burn_rate) cached_gases["o2"][MOLES] = QUANTIZE(cached_gases["o2"][MOLES] - (plasma_burn_rate * oxygen_burn_rate)) cached_gases["co2"][MOLES] += plasma_burn_rate diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 2b5a94ef647..df5470d219e 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -96,7 +96,7 @@ var/datum/gas_mixture/filtered_out = new filtered_out.temperature = removed.temperature - filtered_out.assert_gas(filter_type) + ASSERT_GAS(filtered_out, filter_type) filtered_out.gases[filter_type][MOLES] = removed.gases[filter_type][MOLES] removed.gases[filter_type][MOLES] = 0 @@ -166,4 +166,3 @@ if(. && on && is_operational()) to_chat(user, "You cannot unwrench [src], turn it off first!") return FALSE - diff --git a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm index b953fb29021..ff260426c0b 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm @@ -47,7 +47,7 @@ var/added_oxygen = oxygen_content - total_moles air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) - air_contents.assert_gas("o2") + ASSERT_GAS(air_contents, "o2") air_contents.gases["o2"][MOLES] += added_oxygen update_parents() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm index 4b2b1843fec..3d21d335847 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm @@ -16,7 +16,7 @@ air_contents.volume = volume air_contents.temperature = T20C if(gas_type) - air_contents.assert_gas(gas_type) + ASSERT_GAS(air_contents, gas_type) air_contents.gases[gas_type][MOLES] = AIR_CONTENTS name = "[name] ([air_contents.gases[gas_type][GAS_META][META_GAS_NAME]])" diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm index 20439e5c2b7..f9f4502169f 100644 --- a/code/modules/atmospherics/machinery/other/miner.dm +++ b/code/modules/atmospherics/machinery/other/miner.dm @@ -132,7 +132,7 @@ if(!isopenturf(O)) return FALSE var/datum/gas_mixture/merger = new - merger.assert_gas(spawn_id) + ASSERT_GAS(merger, spawn_id) merger.gases[spawn_id][MOLES] = (spawn_mol) merger.temperature = spawn_temp O.assume_air(merger) From 1df9bdda11367f515ab418922680055f6fc05307 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Fri, 6 Oct 2017 20:51:16 +0300 Subject: [PATCH 05/24] reverting heat capacity change --- code/modules/atmospherics/gasmixtures/gas_mixture.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 4e05d285abd..d676162f2f7 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -71,6 +71,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) /datum/gas_mixture/proc/heat_capacity() //joules per kelvin var/list/cached_gases = gases + . = 0 for(var/id in cached_gases) var/gas_data = cached_gases[id] . += gas_data[MOLES] * gas_data[GAS_META][META_GAS_SPECIFIC_HEAT] From a3188eb30cffc81a8cf1a08cf007f1a79453ad1d Mon Sep 17 00:00:00 2001 From: Y0SH1M4S73R Date: Fri, 6 Oct 2017 14:32:03 -0400 Subject: [PATCH 06/24] Overloaded leg actuators now consume at least 100 power per step --- code/game/mecha/mecha_actions.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 4102ba914b1..8da9caf4438 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -203,7 +203,7 @@ chassis.leg_overload_mode = 1 chassis.bumpsmash = 1 chassis.step_in = min(1, round(chassis.step_in/2)) - chassis.step_energy_drain = chassis.step_energy_drain*chassis.leg_overload_coeff + chassis.step_energy_drain = max(100,chassis.step_energy_drain*chassis.leg_overload_coeff) chassis.occupant_message("You enable leg actuators overload.") else chassis.leg_overload_mode = 0 From 8f5ee3927c10bd7edbb7e324a734cdd6ff6ec853 Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Fri, 6 Oct 2017 11:55:34 -0700 Subject: [PATCH 07/24] Some tweaks --- code/controllers/configuration/entries/config.dm | 2 +- config/config.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm index e7cb363e553..3be6db06c71 100644 --- a/code/controllers/configuration/entries/config.dm +++ b/code/controllers/configuration/entries/config.dm @@ -370,5 +370,5 @@ CONFIG_TWEAK(number/mc_tick_rate) CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val)) . = ..() - if (. && Master) + if (.) Master.UpdateTickRate() diff --git a/config/config.txt b/config/config.txt index 61a5b1c9d4c..39ebc952b6b 100644 --- a/config/config.txt +++ b/config/config.txt @@ -236,7 +236,7 @@ TICK_LIMIT_MC_INIT 500 ## This also controls the client network update rate, as well as the default client fps TICKLAG 0.5 -##Can also be set as per-second value, the follow value is identical to the above. +##Can also be set as per-second value, the following value is identical to the above. #FPS 20 ## Comment this out to disable automuting From 513ff5a10fbb01d60664cd8096b60c950d64c70b Mon Sep 17 00:00:00 2001 From: Y0SH1M4S73R Date: Fri, 6 Oct 2017 15:01:57 -0400 Subject: [PATCH 08/24] Adds an admin-editable var for the minimum amount of power that should be drawn by overloaded leg actuators --- code/game/mecha/mecha.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 6d9c3f25734..dd4e9d98592 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -30,6 +30,7 @@ var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South. var/step_energy_drain = 10 var/melee_energy_drain = 15 + var/overload_step_energy_drain_min = 100 max_integrity = 300 //max_integrity is base health var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act. armor = list(melee = 20, bullet = 10, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 100) From 509156ed68d86ff5895156e4c9584a870468fec3 Mon Sep 17 00:00:00 2001 From: Y0SH1M4S73R Date: Fri, 6 Oct 2017 15:03:13 -0400 Subject: [PATCH 09/24] Applies the overload_step_energy_drain_min to the overload activation proc --- code/game/mecha/mecha_actions.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 8da9caf4438..96576db1544 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -203,7 +203,7 @@ chassis.leg_overload_mode = 1 chassis.bumpsmash = 1 chassis.step_in = min(1, round(chassis.step_in/2)) - chassis.step_energy_drain = max(100,chassis.step_energy_drain*chassis.leg_overload_coeff) + chassis.step_energy_drain = max(chassis.overload_step_energy_drain_min,chassis.step_energy_drain*chassis.leg_overload_coeff) chassis.occupant_message("You enable leg actuators overload.") else chassis.leg_overload_mode = 0 From f044ba1449b9307cf7672798aa057d576526d8a4 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sat, 7 Oct 2017 03:35:33 +0300 Subject: [PATCH 10/24] Breaking protocol by not testing this change, still compiles though --- code/__DEFINES/atmospherics.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 16f8c780408..d8485c003ed 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -177,10 +177,10 @@ #define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity()) -//ASSERT_GAS(gas_mixture,gas_id) - used to guarantee that the gas list for this id exists in gas_mixture. -//Must be used before adding to a gas. May be used before reading from a gas. -#define ASSERT_GAS(gas_mixture,gas_id) if (!gas_mixture.gases[gas_id]) { GASLIST(gas_id, gas_mixture.gases[gas_id]) }; - #define GASLIST(id, out_list)\ var/list/tmp_gaslist = GLOB.gaslist_cache[id];\ - out_list = tmp_gaslist.Copy(); \ No newline at end of file + out_list = tmp_gaslist.Copy(); + +//ASSERT_GAS(gas_mixture,gas_id) - used to guarantee that the gas list for this id exists in gas_mixture. +//Must be used before adding to a gas. May be used before reading from a gas. +#define ASSERT_GAS(gas_mixture,gas_id) if (!gas_mixture.gases[gas_id]) { GASLIST(gas_id, gas_mixture.gases[gas_id]) }; \ No newline at end of file From 890ba9dbe1e9ceb8c3dcd092e6259b6ce4215610 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sat, 7 Oct 2017 04:34:24 +0300 Subject: [PATCH 11/24] Imminent danger of skeletons * Renamed GASLIST into ADD_GAS * Reordered ASSERT_GAS arguments around * Replaced all instances of add_gas with the define * Removed once instance of manual duplication of ASSERT_GAS with the real deal --- code/__DEFINES/atmospherics.dm | 10 +++---- .../game/mecha/equipment/tools/other_tools.dm | 2 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/items/tanks/jetpack.dm | 2 +- code/game/objects/items/tanks/tank_types.dm | 11 ++++--- code/game/turfs/turf.dm | 2 +- code/modules/admin/verbs/debug.dm | 2 +- .../atmospherics/gasmixtures/gas_mixture.dm | 29 ++++++++----------- .../gasmixtures/immutable_mixtures.dm | 2 +- .../atmospherics/gasmixtures/reactions.dm | 8 ++--- .../components/trinary_devices/filter.dm | 2 +- .../unary_devices/oxygen_generator.dm | 2 +- .../components/unary_devices/tank.dm | 2 +- .../components/unary_devices/vent_scrubber.dm | 14 ++++----- .../atmospherics/machinery/other/miner.dm | 2 +- .../machinery/portable/canister.dm | 2 +- .../machinery/portable/scrubber.dm | 2 +- 17 files changed, 45 insertions(+), 51 deletions(-) diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index d8485c003ed..c38f4d932ed 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -177,10 +177,10 @@ #define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity()) -#define GASLIST(id, out_list)\ - var/list/tmp_gaslist = GLOB.gaslist_cache[id];\ - out_list = tmp_gaslist.Copy(); +#define ADD_GAS(gas_id, out_list)\ + var/list/tmp_gaslist = GLOB.gaslist_cache[gas_id];\ + out_list[gas_id] = tmp_gaslist.Copy(); -//ASSERT_GAS(gas_mixture,gas_id) - used to guarantee that the gas list for this id exists in gas_mixture. +//ASSERT_GAS(gas_id, gas_mixture) - used to guarantee that the gas list for this id exists in gas_mixture.gases. //Must be used before adding to a gas. May be used before reading from a gas. -#define ASSERT_GAS(gas_mixture,gas_id) if (!gas_mixture.gases[gas_id]) { GASLIST(gas_id, gas_mixture.gases[gas_id]) }; \ No newline at end of file +#define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) }; diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 5e89c6552ab..79c54874f08 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -430,7 +430,7 @@ if(!istype(T)) return var/datum/gas_mixture/GM = new - ASSERT_GAS(GM,"plasma") + ASSERT_GAS("plasma", GM) if(prob(10)) GM.gases["plasma"][MOLES] += 100 GM.temperature = 1500+T0C //should be enough to start a fire diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 2636b90f21d..538ea3bd84b 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -169,7 +169,7 @@ qdel(H) var/list/G_gases = G.gases if(G_gases["plasma"]) - ASSERT_GAS(G,"n2") + ASSERT_GAS("n2", G) G_gases["n2"][MOLES] += (G_gases["plasma"][MOLES]) G_gases["plasma"][MOLES] = 0 G.garbage_collect() diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index 3c998ca3ccd..63e9e0bb55f 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -17,7 +17,7 @@ /obj/item/tank/jetpack/New() ..() if(gas_type) - ASSERT_GAS(air_contents,gas_type) + ASSERT_GAS(gas_type,air_contents) air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C) ion_trail = new diff --git a/code/game/objects/items/tanks/tank_types.dm b/code/game/objects/items/tanks/tank_types.dm index b4f6393b6bb..146693dd055 100644 --- a/code/game/objects/items/tanks/tank_types.dm +++ b/code/game/objects/items/tanks/tank_types.dm @@ -21,7 +21,7 @@ /obj/item/tank/internals/oxygen/New() ..() - ASSERT_GAS(air_contents, "o2") + ASSERT_GAS("o2", air_contents) air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -87,7 +87,7 @@ /obj/item/tank/internals/plasma/New() ..() - ASSERT_GAS(air_contents,"plasma") + ASSERT_GAS("plasma", air_contents) air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -105,8 +105,7 @@ return ..() /obj/item/tank/internals/plasma/full/New() - ..() - ASSERT_GAS(air_contents,"plasma") + ..() // Plasma asserted in parent air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -125,7 +124,7 @@ /obj/item/tank/internals/plasmaman/New() ..() - ASSERT_GAS(air_contents,"plasma") + ASSERT_GAS("plasma", air_contents) air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return @@ -167,7 +166,7 @@ /obj/item/tank/internals/emergency_oxygen/New() ..() - ASSERT_GAS(air_contents,"o2") + ASSERT_GAS("o2", air_contents) air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 206d53b6d2a..33d74892290 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -290,7 +290,7 @@ continue var/list/S_gases = S.air.gases for(var/id in S_gases) - ASSERT_GAS(total, id) + ASSERT_GAS(id, total) total_gases[id][MOLES] += S_gases[id][MOLES] total.temperature += S.air.temperature diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 30034a6ac16..f670fe760a3 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -716,7 +716,7 @@ GLOBAL_PROTECT(LastAdminCalledProc) if(Rad.anchored) if(!Rad.loaded_tank) var/obj/item/tank/internals/plasma/Plasma = new/obj/item/tank/internals/plasma(Rad) - ASSERT_GAS(Plasma.air_contents, "plasma") + ASSERT_GAS("plasma", Plasma.air_contents) Plasma.air_contents.gases["plasma"][MOLES] = 70 Rad.drainratio = 0 Rad.loaded_tank = Plasma diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index d676162f2f7..b9cba55ae6e 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -39,22 +39,18 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) //listmos procs +// The following procs used to live here: thermal_energy(), assert_gas() and add_gas(). They have been moved into defines in code/__DEFINES/atmospherics.dm + //assert_gases(args) - shorthand for calling ASSERT_GAS() once for each gas type. /datum/gas_mixture/proc/assert_gases() for(var/id in args) - ASSERT_GAS(src,id) - - //add_gas(gas_id) - similar to assert_gas(), but does not check for an existing - //gas list for this id. This can clobber existing gases. - //Used instead of assert_gas() when you know the gas does not exist. Faster than assert_gas(). -/datum/gas_mixture/proc/add_gas(gas_id) - GASLIST(gas_id, gases[gas_id]) + ASSERT_GAS(id, src) //add_gases(args) - shorthand for calling add_gas() once for each gas_type. /datum/gas_mixture/proc/add_gases() var/cached_gases = gases for(var/id in args) - GASLIST(id, cached_gases[id]) + ADD_GAS(id, cached_gases) //garbage_collect() - removes any gas list which is empty. //If called with a list as an argument, only removes gas lists with IDs from that list. @@ -184,7 +180,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) var/list/giver_gases = giver.gases //gas transfer for(var/giver_id in giver_gases) - ASSERT_GAS(src, giver_id) + ASSERT_GAS(giver_id, src) cached_gases[giver_id][MOLES] += giver_gases[giver_id][MOLES] return 1 @@ -201,7 +197,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) removed.temperature = temperature for(var/id in cached_gases) - removed.add_gas(id) + ADD_GAS(id, removed.gases) removed_gases[id][MOLES] = QUANTIZE((cached_gases[id][MOLES] / sum) * amount) cached_gases[id][MOLES] -= removed_gases[id][MOLES] garbage_collect() @@ -219,7 +215,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) removed.temperature = temperature for(var/id in cached_gases) - removed.add_gas(id) + ADD_GAS(id, removed.gases) removed_gases[id][MOLES] = QUANTIZE(cached_gases[id][MOLES] * ratio) cached_gases[id][MOLES] -= removed_gases[id][MOLES] @@ -234,7 +230,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) copy.temperature = temperature for(var/id in cached_gases) - copy.add_gas(id) + ADD_GAS(id, copy.gases) copy_gases[id][MOLES] = cached_gases[id][MOLES] return copy @@ -246,7 +242,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) temperature = sample.temperature for(var/id in sample_gases) - ASSERT_GAS(src,id) + ASSERT_GAS(id,src) cached_gases[id][MOLES] = sample_gases[id][MOLES] //remove all gases not in the sample @@ -272,7 +268,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) gas -= "TEMP" gases.Cut() for(var/id in gas) - add_gas(id) + ADD_GAS(id, gases) gases[id][MOLES] = text2num(gas[id]) return 1 @@ -300,10 +296,9 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) //GAS TRANSFER for(var/id in sharer_gases - cached_gases) // create gases not in our cache - add_gas(id) + ADD_GAS(id, gases) for(var/id in cached_gases) // transfer gases - if(!sharer_gases[id]) //checking here prevents an uneeded proc call if the check fails. - sharer.add_gas(id) + ASSERT_GAS(id, sharer) var/gas = cached_gases[id] var/sharergas = sharer_gases[id] diff --git a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm index 086e21daca2..50e1b38e52f 100644 --- a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm +++ b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm @@ -69,7 +69,7 @@ /datum/gas_mixture/immutable/cloner/garbage_collect() ..() - add_gas("n2") + ADD_GAS("n2", gases) gases["n2"][MOLES] = MOLES_O2STANDARD + MOLES_N2STANDARD /datum/gas_mixture/immutable/cloner/heat_capacity() diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index 750132dcd22..c4662134090 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -57,7 +57,7 @@ cached_gases["co2"][MOLES] -= reaction_rate cached_gases["agent_b"][MOLES] -= reaction_rate*0.05 - ASSERT_GAS(air, "o2") //only need to assert oxygen, as this reaction doesn't occur without the other gases existing + ASSERT_GAS("o2", air) //only need to assert oxygen, as this reaction doesn't occur without the other gases existing cached_gases["o2"][MOLES] += reaction_rate air.temperature -= (reaction_rate*20000)/air.heat_capacity() @@ -126,7 +126,7 @@ if(burned_fuel) energy_released += FIRE_CARBON_ENERGY_RELEASED * burned_fuel - ASSERT_GAS(air, "co2") + ASSERT_GAS("co2", air) cached_gases["co2"][MOLES] += burned_fuel cached_results[id] += burned_fuel @@ -142,14 +142,14 @@ else temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE) if(temperature_scale > 0) - ASSERT_GAS(air, "o2") + ASSERT_GAS("o2", air) oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale if(cached_gases["o2"][MOLES] > cached_gases["plasma"][MOLES]*PLASMA_OXYGEN_FULLBURN) plasma_burn_rate = (cached_gases["plasma"][MOLES]*temperature_scale)/PLASMA_BURN_RATE_DELTA else plasma_burn_rate = (temperature_scale*(cached_gases["o2"][MOLES]/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY) - ASSERT_GAS(air, "co2") + ASSERT_GAS("co2", air) cached_gases["plasma"][MOLES] = QUANTIZE(cached_gases["plasma"][MOLES] - plasma_burn_rate) cached_gases["o2"][MOLES] = QUANTIZE(cached_gases["o2"][MOLES] - (plasma_burn_rate * oxygen_burn_rate)) cached_gases["co2"][MOLES] += plasma_burn_rate diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index df5470d219e..4e3ef0f3cc8 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -96,7 +96,7 @@ var/datum/gas_mixture/filtered_out = new filtered_out.temperature = removed.temperature - ASSERT_GAS(filtered_out, filter_type) + ASSERT_GAS(filter_type, filtered_out) filtered_out.gases[filter_type][MOLES] = removed.gases[filter_type][MOLES] removed.gases[filter_type][MOLES] = 0 diff --git a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm index ff260426c0b..7418205c7b5 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/oxygen_generator.dm @@ -47,7 +47,7 @@ var/added_oxygen = oxygen_content - total_moles air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) - ASSERT_GAS(air_contents, "o2") + ASSERT_GAS("o2", air_contents) air_contents.gases["o2"][MOLES] += added_oxygen update_parents() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm index 3d21d335847..3b0055edab4 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm @@ -16,7 +16,7 @@ air_contents.volume = volume air_contents.temperature = T20C if(gas_type) - ASSERT_GAS(air_contents, gas_type) + ASSERT_GAS(gas_type, air_contents) air_contents.gases[gas_type][MOLES] = AIR_CONTENTS name = "[name] ([air_contents.gases[gas_type][GAS_META][META_GAS_NAME]])" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 251eab55511..326f47aac4f 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -196,37 +196,37 @@ filtered_out.temperature = removed.temperature if(scrub_Toxins && removed_gases["plasma"]) - filtered_out.add_gas("plasma") + ADD_GAS("plasma", filtered_out.gases) filtered_gases["plasma"][MOLES] = removed_gases["plasma"][MOLES] removed_gases["plasma"][MOLES] = 0 if(scrub_CO2 && removed_gases["co2"]) - filtered_out.add_gas("co2") + ADD_GAS("co2", filtered_out.gases) filtered_gases["co2"][MOLES] = removed_gases["co2"][MOLES] removed_gases["co2"][MOLES] = 0 if(removed_gases["agent_b"]) - filtered_out.add_gas("agent_b") + ADD_GAS("agent_b", filtered_out.gases) filtered_gases["agent_b"][MOLES] = removed_gases["agent_b"][MOLES] removed_gases["agent_b"][MOLES] = 0 if(scrub_N2O && removed_gases["n2o"]) - filtered_out.add_gas("n2o") + ADD_GAS("n2o", filtered_out.gases) filtered_gases["n2o"][MOLES] = removed_gases["n2o"][MOLES] removed_gases["n2o"][MOLES] = 0 if(scrub_BZ && removed_gases["bz"]) - filtered_out.add_gas("bz") + ADD_GAS("bz", filtered_out.gases) filtered_gases["bz"][MOLES] = removed_gases["bz"][MOLES] removed_gases["bz"][MOLES] = 0 if(scrub_Freon && removed_gases["freon"]) - filtered_out.add_gas("freon") + ADD_GAS("freon", filtered_out.gases) filtered_gases["freon"][MOLES] = removed_gases["freon"][MOLES] removed_gases["freon"][MOLES] = 0 if(scrub_WaterVapor && removed_gases["water_vapor"]) - filtered_out.add_gas("water_vapor") + ADD_GAS("water_vapor", filtered_out.gases) filtered_gases["water_vapor"][MOLES] = removed_gases["water_vapor"][MOLES] removed_gases["water_vapor"][MOLES] = 0 diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm index f9f4502169f..1db4c5edd3a 100644 --- a/code/modules/atmospherics/machinery/other/miner.dm +++ b/code/modules/atmospherics/machinery/other/miner.dm @@ -132,7 +132,7 @@ if(!isopenturf(O)) return FALSE var/datum/gas_mixture/merger = new - ASSERT_GAS(merger, spawn_id) + ASSERT_GAS(spawn_id, merger) merger.gases[spawn_id][MOLES] = (spawn_mol) merger.temperature = spawn_temp O.assume_air(merger) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 024330ed7e7..c08ef25b617 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -174,7 +174,7 @@ /obj/machinery/portable_atmospherics/canister/proc/create_gas() if(gas_type) - air_contents.add_gas(gas_type) + ADD_GAS(gas_type, air_contents.gases) if(starter_temp) air_contents.temperature = starter_temp air_contents.gases[gas_type][MOLES] = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature) diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 93475a00a72..7a76405a900 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -45,7 +45,7 @@ filtered.temperature = filtering.temperature for(var/gas in filtering.gases & scrubbing) - filtered.add_gas(gas) + ADD_GAS(gas, filtered.gases) filtered.gases[gas][MOLES] = filtering.gases[gas][MOLES] // Shuffle the "bad" gasses to the filtered mixture. filtering.gases[gas][MOLES] = 0 filtering.garbage_collect() // Now that the gasses are set to 0, clean up the mixture. From 0dc9bd9d7585a936b80eeb5f84bbcb964da55d3c Mon Sep 17 00:00:00 2001 From: AnturK Date: Fri, 6 Oct 2017 09:54:55 +0200 Subject: [PATCH 12/24] Fixes clockcult runtime --- code/__DEFINES/clockcult.dm | 2 -- .../gamemodes/clock_cult/clock_items/replica_fabricator.dm | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/clockcult.dm b/code/__DEFINES/clockcult.dm index fc93ccbf1cf..5f167bf96c9 100644 --- a/code/__DEFINES/clockcult.dm +++ b/code/__DEFINES/clockcult.dm @@ -55,8 +55,6 @@ GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not us #define POWER_PLASTEEL (CLOCKCULT_POWER_UNIT*0.05) //how much power is in one sheet of plasteel -#define RATVAR_POWER_CHECK "ratvar?" //when passed into can_use_power(), converts it into a check for if ratvar has woken/the fabricator is debug - //Ark defines #define GATEWAY_SUMMON_RATE 1 //the time amount the Gateway to the Celestial Derelict gets each process tick; defaults to 1 per tick diff --git a/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm b/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm index ae001c03e5b..44fa24c1346 100644 --- a/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm +++ b/code/game/gamemodes/clock_cult/clock_items/replica_fabricator.dm @@ -90,7 +90,7 @@ if(!no_table_check) return TRUE return FALSE - if(get_clockwork_power(RATVAR_POWER_CHECK)) + if(GLOB.ratvar_awakens) fabrication_values["power_cost"] = 0 var/turf/Y = get_turf(user) @@ -167,7 +167,7 @@ return FALSE if(target.type != expected_type) return FALSE - if(get_clockwork_power(RATVAR_POWER_CHECK)) + if(GLOB.ratvar_awakens) fabrication_values["power_cost"] = 0 if(!get_clockwork_power(fabrication_values["power_cost"])) if(get_clockwork_power() - fabrication_values["power_cost"] < 0) @@ -212,7 +212,7 @@ return FALSE repair_values["healing_for_cycle"] = min(repair_values["amount_to_heal"], FABRICATOR_REPAIR_PER_TICK) //modify the healing for this cycle repair_values["power_required"] = round(repair_values["healing_for_cycle"]*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER) //and get the power cost from that - if(!get_clockwork_power(RATVAR_POWER_CHECK) && !get_clockwork_power(repair_values["power_required"])) + if(!GLOB.ratvar_awakens && !get_clockwork_power(repair_values["power_required"])) if(!silent) to_chat(user, "You need at least [DisplayPower(repair_values["power_required"])] power to start repairin[target == user ? "g yourself" : "g [target]"], and at least \ [DisplayPower(repair_values["amount_to_heal"]*MIN_CLOCKCULT_POWER, MIN_CLOCKCULT_POWER)] to fully repair [target == user ? "yourself" : "[target.p_them()]"]!") From 4e71c815af8da3d8c3dc8f8a6e7f94c9d98fa4cf Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Sat, 7 Oct 2017 06:36:19 -0700 Subject: [PATCH 13/24] Adds a rdconsole to omegastation robotics (#31380) --- _maps/map_files/OmegaStation/OmegaStation.dmm | 1 + 1 file changed, 1 insertion(+) diff --git a/_maps/map_files/OmegaStation/OmegaStation.dmm b/_maps/map_files/OmegaStation/OmegaStation.dmm index d5c02647eb1..32bebbb6a0e 100644 --- a/_maps/map_files/OmegaStation/OmegaStation.dmm +++ b/_maps/map_files/OmegaStation/OmegaStation.dmm @@ -30349,6 +30349,7 @@ dir = 8 }, /obj/effect/turf_decal/bot, +/obj/machinery/computer/rdconsole, /turf/open/floor/plasteel, /area/science/robotics/lab) "bbP" = ( From 2a51751dad56bc9a1123e6c23d2b0050543a9048 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Sat, 7 Oct 2017 06:39:39 -0700 Subject: [PATCH 14/24] Lets cyborgs use ladders (#31378) --- code/game/objects/structures/ladders.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index d0ad32113d5..6093d73bc54 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -100,6 +100,10 @@ /obj/structure/ladder/attackby(obj/item/W, mob/user, params) return attack_hand(user) +/obj/structure/ladder/attack_robot(mob/living/silicon/robot/R) + if(R.Adjacent(src)) + return attack_hand(R) + /obj/structure/ladder/attack_ghost(mob/dead/observer/user) use(user,1) From e709e0080c8b417497c01c9f103c441cfe3940cb Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Sat, 7 Oct 2017 08:41:04 -0500 Subject: [PATCH 15/24] Nightmare spawn event (#31376) * Nightmare Event * Update nightmare.dm * Standards --- code/modules/events/nightmare.dm | 43 ++++++++++++++++++++++++++++++++ tgstation.dme | 1 + 2 files changed, 44 insertions(+) create mode 100644 code/modules/events/nightmare.dm diff --git a/code/modules/events/nightmare.dm b/code/modules/events/nightmare.dm new file mode 100644 index 00000000000..7be5db8e842 --- /dev/null +++ b/code/modules/events/nightmare.dm @@ -0,0 +1,43 @@ +/datum/round_event_control/nightmare + name = "Spawn Nightmare" + typepath = /datum/round_event/ghost_role/nightmare + max_occurrences = 1 + min_players = 20 + +/datum/round_event/ghost_role/nightmare + minimum_required = 1 + role_name = "nightmare" + +/datum/round_event/ghost_role/nightmare/spawn_role() + var/list/candidates = get_candidates("alien", null, ROLE_ALIEN) + if(!candidates.len) + return NOT_ENOUGH_PLAYERS + + var/mob/dead/selected = pick(candidates) + + var/datum/mind/player_mind = new /datum/mind(selected.key) + player_mind.active = TRUE + + var/list/spawn_locs = list() + for(var/obj/effect/landmark/xeno_spawn/L in GLOB.landmarks_list) + if(isturf(L.loc)) + var/turf/T = L.loc + var/light_amount = T.get_lumcount() + if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) + spawn_locs += T + + if(!spawn_locs.len) + message_admins("No valid spawn locations found, aborting...") + return MAP_ERROR + + var/mob/living/carbon/human/S = new ((pick(spawn_locs))) + player_mind.transfer_to(S) + player_mind.assigned_role = "Nightmare" + player_mind.special_role = "Nightmare" + SSticker.mode.traitors += player_mind + S.set_species(/datum/species/shadow/nightmare) + playsound(S, 'sound/magic/ethereal_exit.ogg', 50, 1, -1) + message_admins("[key_name_admin(S)] has been made into a Nightmare by an event.") + log_game("[key_name(S)] was spawned as a Nightmare by an event.") + spawned_mobs += S + return SUCCESSFUL_SPAWN diff --git a/tgstation.dme b/tgstation.dme index 3f39e29ea60..387d1afbf54 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1278,6 +1278,7 @@ #include "code\modules\events\meateor_wave.dm" #include "code\modules\events\meteor_wave.dm" #include "code\modules\events\mice_migration.dm" +#include "code\modules\events\nightmare.dm" #include "code\modules\events\operative.dm" #include "code\modules\events\portal_storm.dm" #include "code\modules\events\prison_break.dm" From 981e946909453622bb8bf8acd8d41e11a32a5c1b Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 06:41:07 -0700 Subject: [PATCH 16/24] Automatic changelog generation for PR #31376 [ci skip] --- html/changelogs/AutoChangeLog-pr-31376.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31376.yml diff --git a/html/changelogs/AutoChangeLog-pr-31376.yml b/html/changelogs/AutoChangeLog-pr-31376.yml new file mode 100644 index 00000000000..e4061e3cd6a --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31376.yml @@ -0,0 +1,4 @@ +author: "Kor" +delete-after: True +changes: + - rscadd: "Nightmares now have a chance to spawn via event." From 63bdf3fcb6c3b384f3f2232c96bffd77d3dac54f Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 06:42:17 -0700 Subject: [PATCH 17/24] Automatic changelog generation for PR #31374 [ci skip] --- html/changelogs/AutoChangeLog-pr-31374.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31374.yml diff --git a/html/changelogs/AutoChangeLog-pr-31374.yml b/html/changelogs/AutoChangeLog-pr-31374.yml new file mode 100644 index 00000000000..45d6c5241d4 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31374.yml @@ -0,0 +1,6 @@ +author: "MrStonedOne" +delete-after: True +changes: + - tweak: "The MC will now reduce tick rate during high populations to keep it from fighting with byond for processing time." + - config: "Added config options to control MC tick rate" + - admin: "Admins can no longer manually control the mc's tick rate by editing the MC's processing value, instead you will have to edit the config datum's values for high/low pop tick rates." From 943da9aa20b64d5b2b8d2a32a2df0e001141f4ba Mon Sep 17 00:00:00 2001 From: WJohn Date: Sat, 7 Oct 2017 12:05:19 -0400 Subject: [PATCH 18/24] Adds navigation consoles to boxstation and metastation white ships. (#31367) * Adds navigation consoles to box and metastation whiteships. * Whoops offsets metastation has a smaller whiteship dummy * Updates whiteship templates for box and meta. --- _maps/map_files/BoxStation/BoxStation.dmm | 22 +++++---- _maps/map_files/MetaStation/MetaStation.dmm | 53 +++++++++++++++++---- _maps/shuttles/whiteship_box.dmm | 6 ++- _maps/shuttles/whiteship_meta.dmm | 53 +++++++++++++++++---- code/modules/shuttle/white_ship.dm | 15 +++++- 5 files changed, 122 insertions(+), 27 deletions(-) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 920f6c5cdf0..138c9d53f90 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -2281,7 +2281,7 @@ name = "Emergency Shuttle Airlock" }, /obj/docking_port/mobile/emergency{ - name = "Box emergency shuttle"; + name = "Box emergency shuttle" }, /obj/docking_port/stationary{ dir = 4; @@ -64022,6 +64022,10 @@ /obj/machinery/atmospherics/pipe/simple/supply/hidden, /turf/open/floor/plating, /area/maintenance/department/medical/morgue) +"cTW" = ( +/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship, +/turf/open/floor/mineral/titanium, +/area/shuttle/abandoned) (1,1,1) = {" aaa @@ -75982,7 +75986,7 @@ aaa cyc cyy cyc -czy +cTW cyO cyi cyi @@ -105020,7 +105024,7 @@ bfS biE bkf bfS -cTP +cTO bmZ bpL bre @@ -105277,7 +105281,7 @@ bfS biD bke bfS -cTQ +cTO bmZ bpK brd @@ -105534,7 +105538,7 @@ bfS bfS bfS bfS -cTR +cTO bmZ bon bon @@ -105790,13 +105794,13 @@ cTJ cHD bgo cTK -cTN +cTK blq cTS -cTT +cTK bpQ -cTU -cTV +cTK +cTJ btm buy bvz diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 6451ef82ae7..8c17948b1fb 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -79816,7 +79816,6 @@ /area/shuttle/abandoned) "cWT" = ( /obj/structure/table, -/obj/item/device/camera, /obj/effect/decal/cleanable/dirt{ desc = "A thin layer of dust coating the floor."; name = "dust" @@ -79824,6 +79823,8 @@ /obj/structure/light_construct{ dir = 1 }, +/obj/item/folder/blue, +/obj/item/pen, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "cWU" = ( @@ -79832,6 +79833,8 @@ desc = "A thin layer of dust coating the floor."; name = "dust" }, +/obj/structure/table, +/obj/item/device/camera, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "cWV" = ( @@ -80229,13 +80232,15 @@ /turf/open/floor/mineral/titanium/blue, /area/shuttle/abandoned) "cXH" = ( -/obj/structure/table, /obj/effect/decal/cleanable/dirt{ desc = "A thin layer of dust coating the floor."; name = "dust" }, -/obj/item/device/megaphone, /obj/structure/light_construct, +/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship{ + x_offset = -3; + y_offset = -7 + }, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "cXI" = ( @@ -90386,6 +90391,38 @@ /obj/machinery/atmospherics/pipe/simple/supply/hidden, /turf/open/floor/plating, /area/maintenance/starboard/fore) +"dDN" = ( +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/chair/office/light{ + dir = 1 + }, +/turf/open/floor/mineral/titanium/blue, +/area/shuttle/abandoned) +"dDO" = ( +/obj/effect/decal/cleanable/blood/old, +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/chair/office/light, +/turf/open/floor/mineral/titanium/blue, +/area/shuttle/abandoned) +"dDP" = ( +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/table, +/obj/item/device/megaphone, +/turf/open/floor/mineral/titanium, +/area/shuttle/abandoned) (1,1,1) = {" aaa @@ -101583,10 +101620,10 @@ cWt cWE cVF cWU -cXe -cWo -cXB cXa +cWo +cXa +dDP cVF cJI cYp @@ -101840,9 +101877,9 @@ cVG cVF cVF cWT -cVY +dDN cWo -cWR +dDO cXH cVF cVF diff --git a/_maps/shuttles/whiteship_box.dmm b/_maps/shuttles/whiteship_box.dmm index 49d9d76a77d..309c366eafd 100644 --- a/_maps/shuttles/whiteship_box.dmm +++ b/_maps/shuttles/whiteship_box.dmm @@ -373,6 +373,10 @@ }, /turf/open/floor/plating, /area/shuttle/abandoned) +"bu" = ( +/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship, +/turf/open/floor/mineral/titanium, +/area/shuttle/abandoned) (1,1,1) = {" aa @@ -1148,7 +1152,7 @@ aa aC ax aC -bb +bu aJ aj aj diff --git a/_maps/shuttles/whiteship_meta.dmm b/_maps/shuttles/whiteship_meta.dmm index 046f6999116..8f4d4eed88c 100644 --- a/_maps/shuttles/whiteship_meta.dmm +++ b/_maps/shuttles/whiteship_meta.dmm @@ -722,11 +722,12 @@ desc = "A thin layer of dust coating the floor."; name = "dust" }, +/obj/structure/table, +/obj/item/device/camera, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "bs" = ( /obj/structure/table, -/obj/item/device/camera, /obj/effect/decal/cleanable/dirt{ desc = "A thin layer of dust coating the floor."; name = "dust" @@ -734,6 +735,8 @@ /obj/structure/light_construct{ dir = 1 }, +/obj/item/folder/blue, +/obj/item/pen, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "bt" = ( @@ -1162,13 +1165,15 @@ /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "cg" = ( -/obj/structure/table, /obj/effect/decal/cleanable/dirt{ desc = "A thin layer of dust coating the floor."; name = "dust" }, -/obj/item/device/megaphone, /obj/structure/light_construct, +/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship{ + x_offset = -3; + y_offset = -7 + }, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) "ch" = ( @@ -1765,6 +1770,38 @@ }, /turf/open/floor/mineral/titanium, /area/shuttle/abandoned) +"dk" = ( +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/chair/office/light{ + dir = 1 + }, +/turf/open/floor/mineral/titanium/blue, +/area/shuttle/abandoned) +"dl" = ( +/obj/effect/decal/cleanable/blood/old, +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/chair/office/light, +/turf/open/floor/mineral/titanium/blue, +/area/shuttle/abandoned) +"dm" = ( +/obj/effect/decal/cleanable/dirt{ + desc = "A thin layer of dust coating the floor."; + name = "dust" + }, +/obj/structure/table, +/obj/item/device/megaphone, +/turf/open/floor/mineral/titanium, +/area/shuttle/abandoned) (1,1,1) = {" aa @@ -2130,10 +2167,10 @@ aR bc ac br -bC -aL -bZ bx +aL +bx +dm ac cA cN @@ -2147,9 +2184,9 @@ ae ac ac bs -ax +dk aL -bp +dl cg ac ac diff --git a/code/modules/shuttle/white_ship.dm b/code/modules/shuttle/white_ship.dm index e3856d3ff1d..422794fe05d 100644 --- a/code/modules/shuttle/white_ship.dm +++ b/code/modules/shuttle/white_ship.dm @@ -3,4 +3,17 @@ desc = "Used to control the White Ship." circuit = /obj/item/circuitboard/computer/white_ship shuttleId = "whiteship" - possible_destinations = "whiteship_away;whiteship_home;whiteship_z4;whiteship_lavaland" \ No newline at end of file + possible_destinations = "whiteship_away;whiteship_home;whiteship_z4;whiteship_lavaland;whiteship_custom" + +/obj/machinery/computer/camera_advanced/shuttle_docker/whiteship + name = "White Ship Navigation Computer" + desc = "Used to designate a precise transit location for the White Ship." + shuttleId = "whiteship" + station_lock_override = TRUE + shuttlePortId = "whiteship_custom" + shuttlePortName = "Custom Location" + jumpto_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1) + view_range = 20 + x_offset = -6 + y_offset = -10 + From b2a4c7d6888c5dee7c2798b9d2e610e399f104f7 Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 09:05:22 -0700 Subject: [PATCH 19/24] Automatic changelog generation for PR #31367 [ci skip] --- html/changelogs/AutoChangeLog-pr-31367.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31367.yml diff --git a/html/changelogs/AutoChangeLog-pr-31367.yml b/html/changelogs/AutoChangeLog-pr-31367.yml new file mode 100644 index 00000000000..edb15b8b85c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31367.yml @@ -0,0 +1,4 @@ +author: "WJohnston" +delete-after: True +changes: + - rscadd: "Boxstation and Metastation's white ships now have navigation computers, letting you move them around in the station, deep space, and derelict z levels." From b6d349e1d4b5af17a50e3a4081ea0c960379a389 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 7 Oct 2017 13:36:33 -0400 Subject: [PATCH 20/24] Remove drop_item, drop_item_v, put_in_hands_or_del (#31386) --- code/_onclick/hud/screen_objects.dm | 3 ++- .../datums/diseases/advance/symptoms/cough.dm | 2 +- code/datums/martial/cqc.dm | 7 +++---- code/datums/martial/krav_maga.dm | 2 +- code/datums/martial/sleeping_carp.dm | 9 ++++---- code/datums/mutations.dm | 2 +- code/datums/wires/wires.dm | 5 +++-- code/game/gamemodes/antag_spawner.dm | 2 +- .../gamemodes/changeling/powers/mutations.dm | 7 ++++--- .../gamemodes/changeling/powers/tiny_prick.dm | 5 +++-- .../clock_effects/spatial_gateway.dm | 2 +- .../clock_items/clock_components.dm | 1 - .../clock_items/clock_weapons/_call_weapon.dm | 1 - .../clock_cult/clock_items/clockwork_slab.dm | 2 +- code/game/gamemodes/cult/talisman.dm | 7 ++----- .../gamemodes/devil/true_devil/_true_devil.dm | 2 +- .../miniantags/abduction/abduction_surgery.dm | 2 +- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- .../miniantags/slaughter/slaughter.dm | 2 +- code/game/gamemodes/nuclear/nuclear.dm | 5 ++--- code/game/gamemodes/nuclear/nuclearbomb.dm | 9 +++----- code/game/gamemodes/wizard/artefact.dm | 4 ++-- code/game/gamemodes/wizard/wizard.dm | 2 +- code/game/machinery/PDApainter.dm | 14 +++++-------- code/game/machinery/camera/camera.dm | 4 ++-- code/game/machinery/camera/camera_assembly.dm | 3 +-- .../machinery/computer/gulag_teleporter.dm | 15 +++++-------- code/game/machinery/computer/medical.dm | 17 ++++++--------- code/game/machinery/computer/prisoner.dm | 7 +++---- code/game/machinery/computer/security.dm | 15 +++++-------- .../machinery/computer/telecrystalconsoles.dm | 10 ++++----- code/game/machinery/constructable_frame.dm | 6 ++---- code/game/machinery/doors/airlock.dm | 3 +-- code/game/machinery/doors/firedoor.dm | 1 - code/game/machinery/flasher.dm | 3 +-- code/game/machinery/gulag_item_reclaimer.dm | 18 ++++++---------- code/game/machinery/iv_drip.dm | 4 +--- code/game/machinery/newscaster.dm | 8 +++---- code/game/machinery/pipe/pipe_dispenser.dm | 2 -- .../porta_turret/portable_turret_construct.dm | 5 ++--- code/game/machinery/recharger.dm | 3 +-- code/game/machinery/slotmachine.dm | 5 ++--- code/game/machinery/spaceheater.dm | 17 ++++++--------- code/game/machinery/suit_storage_unit.dm | 9 ++++---- code/game/machinery/syndicatebomb.dm | 6 ++---- code/game/machinery/vending.dm | 6 ++---- code/game/mecha/mecha_defense.dm | 5 ++--- .../effects/effect_system/effects_smoke.dm | 3 +-- code/game/objects/items.dm | 2 +- code/game/objects/items/handcuffs.dm | 4 ++-- code/game/objects/items/melee/misc.dm | 6 +++--- code/game/objects/items/paiwire.dm | 3 +-- code/game/objects/items/pneumaticCannon.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/storage/backpack.dm | 2 +- code/game/objects/items/storage/boxes.dm | 6 ++---- code/game/objects/items/toys.dm | 8 +++---- code/game/objects/structures.dm | 2 +- .../objects/structures/beds_chairs/chair.dm | 4 ++-- code/game/objects/structures/bedsheet_bin.dm | 9 ++++---- .../structures/crates_lockers/closets.dm | 3 +-- code/game/objects/structures/door_assembly.dm | 3 +-- code/game/objects/structures/extinguisher.dm | 3 +-- code/game/objects/structures/fireaxe.dm | 3 +-- code/game/objects/structures/girders.dm | 3 +-- code/game/objects/structures/guncase.dm | 3 +-- code/game/objects/structures/janicart.dm | 3 +-- code/game/objects/structures/safe.dm | 3 +-- code/game/objects/structures/signs.dm | 1 - code/game/objects/structures/tables_racks.dm | 10 ++++----- .../game/objects/structures/tank_dispenser.dm | 3 +-- code/game/objects/structures/target_stake.dm | 3 +-- code/game/objects/structures/watercloset.dm | 6 ++---- .../objects/structures/windoor_assembly.dm | 3 +-- .../game/turfs/simulated/floor/light_floor.dm | 2 +- code/modules/assembly/bomb.dm | 12 +++++------ .../components/unary_devices/cryo.dm | 3 +-- .../portable/portable_atmospherics.dm | 3 +-- .../awaymissions/mission_code/Academy.dm | 2 +- code/modules/clothing/clothing.dm | 2 +- .../food_and_drinks/drinks/drinks/bottle.dm | 9 +++----- .../kitchen_machinery/deep_fryer.dm | 3 +-- .../kitchen_machinery/food_cart.dm | 5 +---- .../kitchen_machinery/microwave.dm | 3 +-- .../kitchen_machinery/processor.dm | 3 +-- code/modules/food_and_drinks/pizzabox.dm | 6 ++---- code/modules/holodeck/items.dm | 6 ++---- code/modules/hydroponics/biogenerator.dm | 3 +-- code/modules/hydroponics/gene_modder.dm | 10 ++++----- code/modules/hydroponics/grown/cereals.dm | 3 +-- code/modules/hydroponics/grown/nettle.dm | 2 +- code/modules/hydroponics/seed_extractor.dm | 7 +++---- code/modules/library/lib_items.dm | 3 +-- code/modules/library/lib_machines.dm | 6 ++---- code/modules/mining/fulton.dm | 3 +-- code/modules/mining/laborcamp/laborstacker.dm | 6 ++---- .../mining/lavaland/necropolis_chests.dm | 2 +- code/modules/mining/machine_redemption.dm | 3 +-- code/modules/mining/machine_vending.dm | 6 ++---- code/modules/mining/satchel_ore_boxdm.dm | 4 +--- code/modules/mob/inventory.dm | 20 ++---------------- code/modules/mob/living/brain/brain_item.dm | 3 +-- .../carbon/alien/humanoid/humanoid_defense.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 4 ++-- .../mob/living/carbon/human/interactive.dm | 2 +- .../mob/living/carbon/human/species.dm | 2 +- .../living/carbon/monkey/monkey_defense.dm | 16 ++++++-------- .../modules/mob/living/silicon/robot/robot.dm | 8 +++---- code/modules/mob/living/silicon/silicon.dm | 3 --- .../mob/living/simple_animal/bot/bot.dm | 3 +-- .../mob/living/simple_animal/bot/medbot.dm | 3 +-- .../mob/living/simple_animal/bot/mulebot.dm | 6 ++---- .../mob/living/simple_animal/friendly/dog.dm | 13 ++++++------ .../simple_animal/friendly/farm_animals.dm | 1 - .../mob/living/simple_animal/parrot.dm | 5 ++--- code/modules/mob/mob_movement.dm | 9 ++++---- .../file_system/programs/card.dm | 6 ++---- .../modular_computers/laptop_vendor.dm | 2 +- code/modules/paperwork/filingcabinet.dm | 3 +-- code/modules/paperwork/paper_cutter.dm | 5 ++--- code/modules/paperwork/photocopier.dm | 10 ++++----- code/modules/power/apc.dm | 3 +-- code/modules/power/lighting.dm | 2 +- code/modules/power/singularity/collector.dm | 5 ++--- code/modules/power/solar.dm | 2 +- code/modules/projectiles/box_magazine.dm | 3 +-- code/modules/projectiles/gun.dm | 2 +- .../projectiles/guns/ballistic/revolver.dm | 2 +- .../projectiles/guns/ballistic/shotgun.dm | 4 ++-- .../projectiles/guns/misc/blastcannon.dm | 3 +-- .../chemistry/reagents/drug_reagents.dm | 8 ++----- .../chemistry/reagents/food_reagents.dm | 2 -- .../chemistry/reagents/medicine_reagents.dm | 21 +++++-------------- code/modules/recycling/conveyor2.dm | 3 +-- code/modules/recycling/disposal-unit.dm | 2 +- code/modules/research/destructive_analyzer.dm | 3 +-- code/modules/research/experimentor.dm | 3 +-- code/modules/research/rdconsole.dm | 3 +-- .../research/xenobiology/xenobio_camera.dm | 1 - code/modules/spells/spell_types/conjure.dm | 5 ++--- code/modules/spells/spell_types/devil.dm | 2 +- .../modules/spells/spell_types/devil_boons.dm | 2 +- .../spells/spell_types/infinite_guns.dm | 5 +---- code/modules/surgery/cavity_implant.dm | 3 +-- code/modules/surgery/dental_implant.dm | 3 +-- code/modules/surgery/limb_augmentation.dm | 1 - code/modules/surgery/organ_manipulation.dm | 2 +- code/modules/surgery/organs/autosurgeon.dm | 3 +-- code/modules/surgery/organs/heart.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 5 ++--- .../modules/surgery/prosthetic_replacement.dm | 3 +-- code/modules/vehicles/pimpin_ride.dm | 3 +-- 152 files changed, 271 insertions(+), 457 deletions(-) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 874b17b8f1d..7e597f0e106 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -196,7 +196,8 @@ plane = HUD_PLANE /obj/screen/drop/Click() - usr.drop_item_v() + if(usr.stat == CONSCIOUS) + usr.dropItemToGround(usr.get_active_held_item()) /obj/screen/act_intent name = "intent" diff --git a/code/datums/diseases/advance/symptoms/cough.dm b/code/datums/diseases/advance/symptoms/cough.dm index 81b51e9ae73..f0178576bf4 100644 --- a/code/datums/diseases/advance/symptoms/cough.dm +++ b/code/datums/diseases/advance/symptoms/cough.dm @@ -61,7 +61,7 @@ BONUS if(power >= 1.5) var/obj/item/I = M.get_active_held_item() if(I && I.w_class == WEIGHT_CLASS_TINY) - M.drop_item() + M.dropItemToGround(I) if(power >= 2 && prob(10)) to_chat(M, "[pick("You have a coughing fit!", "You can't stop coughing!")]") M.Stun(20) diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index d740a4213c8..8974c388b1f 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -85,7 +85,7 @@ "[A] strikes your abdomen, neck and back consecutively!") playsound(get_turf(D), 'sound/weapons/cqchit2.ogg', 50, 1, -1) var/obj/item/I = D.get_active_held_item() - if(I && D.drop_item()) + if(I && D.temporarilyRemoveItemFromInventory(I)) A.put_in_hands(I) D.adjustStaminaLoss(50) D.apply_damage(25, BRUTE) @@ -145,7 +145,7 @@ D.visible_message("[A] strikes [D]'s jaw with their hand!", \ "[A] strikes your jaw, disorienting you!") playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1) - if(I && D.drop_item()) + if(I && D.temporarilyRemoveItemFromInventory(I)) A.put_in_hands(I) D.Jitter(2) D.apply_damage(5, BRUTE) @@ -193,7 +193,6 @@ to_chat(user, "You remember the basics of CQC.") var/datum/martial_art/cqc/D = new(null) D.teach(user) - user.drop_item() visible_message("[src] beeps ominously, and a moment later it bursts up in flames.") - new /obj/effect/decal/cleanable/ash(get_turf(src)) qdel(src) + new /obj/effect/decal/cleanable/ash(user.drop_location()) diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index 84f0f00e45b..a898c1866bb 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -150,7 +150,7 @@ if(prob(60)) I = D.get_active_held_item() if(I) - if(D.drop_item()) + if(D.temporarilyRemoveItemFromInventory(I)) A.put_in_hands(I) D.visible_message("[A] has disarmed [D]!", \ "[A] has disarmed [D]!") diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index ac5083cc17b..8fe8fcd3660 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -41,7 +41,7 @@ "[A] grabs your wrist and violently wrenches it to the side!") playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1) D.emote("scream") - D.drop_item() + D.dropItemToGround(D.get_active_held_item()) D.apply_damage(5, BRUTE, pick("l_arm", "r_arm")) D.Stun(60) return 1 @@ -79,7 +79,7 @@ D.visible_message("[A] kicks [D] in the head!", \ "[A] kicks you in the jaw!") D.apply_damage(20, BRUTE, "head") - D.drop_item() + D.drop_all_held_items() playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) D.Stun(80) return 1 @@ -168,10 +168,9 @@ to_chat(user, message) var/datum/martial_art/the_sleeping_carp/theSleepingCarp = new(null) theSleepingCarp.teach(user) - user.drop_item() - visible_message("[src] lights up in fire and quickly burns to ash.") - new /obj/effect/decal/cleanable/ash(get_turf(src)) qdel(src) + visible_message("[src] lights up in fire and quickly burns to ash.") + new /obj/effect/decal/cleanable/ash(user.drop_location()) /obj/item/twohanded/bostaff name = "bo staff" diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index 5b44fd966fe..c3bef23a2a2 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -270,7 +270,7 @@ GLOBAL_LIST_EMPTY(mutations_list) /datum/mutation/human/cough/on_life(mob/living/carbon/human/owner) if(prob(5) && owner.stat == CONSCIOUS) - owner.drop_item() + owner.drop_all_held_items() owner.emote("cough") /datum/mutation/human/dwarfism diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index ae938f18cef..c508907bf4d 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -250,9 +250,10 @@ if(istype(I, /obj/item/device/assembly)) var/obj/item/device/assembly/A = I if(A.attachable) - if(!L.drop_item()) + if(!L.temporarilyRemoveItemFromInventory(A)) return - attach_assembly(target_wire, A) + if(!attach_assembly(target_wire, A)) + A.forceMove(L.drop_location()) . = TRUE else to_chat(L, "You need an attachable assembly!") diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 3b5b8625597..c529ab546d4 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -90,7 +90,7 @@ if("healing") M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null)) M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/forcewall(null)) - M.put_in_hands_or_del(new /obj/item/gun/magic/staff/healing(M)) + M.put_in_hands(new /obj/item/gun/magic/staff/healing(M), TRUE) to_chat(M, "Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned livesaving survival spells. You are able to cast charge and forcewall.") if("robeless") M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null)) diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index 41c843c3f01..f8b25afa5e5 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -37,8 +37,9 @@ return 1 /obj/effect/proc_holder/changeling/weapon/sting_action(mob/living/user) - if(!user.drop_item()) - to_chat(user, "The [user.get_active_held_item()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!") + var/obj/item/held = user.get_active_held_item() + if(held && !user.dropItemToGround(held)) + to_chat(user, "[held] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!") return var/limb_regen = 0 if(user.active_hand_index % 2 == 0) //we regen the arm before changing it into the weapon @@ -338,7 +339,7 @@ if(INTENT_DISARM) var/obj/item/I = C.get_active_held_item() if(I) - if(C.drop_item()) + if(C.dropItemToGround(I)) C.visible_message("[I] is yanked off [C]'s hand by [src]!","A tentacle pulls [I] away from you!") on_hit(I) //grab the item as if you had hit it directly with the tentacle return 1 diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm index b3cdf248aab..c23074c5060 100644 --- a/code/game/gamemodes/changeling/powers/tiny_prick.dm +++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm @@ -127,8 +127,9 @@ /obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) add_logs(user, target, "stung", object="falso armblade sting") - if(!target.drop_item()) - to_chat(user, "The [target.get_active_held_item()] is stuck to their hand, you cannot grow a false armblade over it!") + var/obj/item/held = target.get_active_held_item() + if(held && !target.dropItemToGround(held)) + to_chat(user, "[held] is stuck to their hand, you cannot grow a false armblade over it!") return if(ismonkey(target)) diff --git a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm index 8cb84d43c23..e88f112a0af 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm @@ -88,7 +88,7 @@ if(istype(I, /obj/item/clockwork/slab)) to_chat(user, "\"I don't think you want to drop your slab into that.\"\n\"If you really want to, try throwing it.\"") return TRUE - if(user.drop_item() && uses) + if(uses && user.dropItemToGround(I)) user.visible_message("[user] drops [I] into [src]!", "You drop [I] into [src]!") pass_through_gateway(I, TRUE) return TRUE diff --git a/code/game/gamemodes/clock_cult/clock_items/clock_components.dm b/code/game/gamemodes/clock_cult/clock_items/clock_components.dm index b1409aae186..65c4f9f0afa 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clock_components.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clock_components.dm @@ -20,7 +20,6 @@ "You crush [src], capturing its escaping energy for use as power.") playsound(user, 'sound/effects/pop_expl.ogg', 50, TRUE) adjust_clockwork_power(POWER_WALL_TOTAL) - user.drop_item() qdel(src) /obj/item/clockwork/component/pickup(mob/living/user) diff --git a/code/game/gamemodes/clock_cult/clock_items/clock_weapons/_call_weapon.dm b/code/game/gamemodes/clock_cult/clock_items/clock_weapons/_call_weapon.dm index afe6aca217b..a87767c05e3 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clock_weapons/_call_weapon.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clock_weapons/_call_weapon.dm @@ -28,7 +28,6 @@ if(weapon.loc == owner) owner.visible_message("[owner]'s [weapon.name] flickers and disappears!") to_chat(owner, "You dismiss [weapon].") - owner.drop_item() QDEL_NULL(weapon) weapon_reset(RATVARIAN_SPEAR_COOLDOWN * 0.5) return diff --git a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm index a9c241b2c3f..563e83e9cdc 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm @@ -136,7 +136,7 @@ to_chat(user, "\"You reek of blood. You've got a lot of nerve to even look at that slab.\"") user.visible_message("A sizzling sound comes from [user]'s hands!", "[src] suddenly grows extremely hot in your hands!") playsound(get_turf(user), 'sound/weapons/sear.ogg', 50, 1) - user.drop_item() + user.dropItemToGround(src) user.emote("scream") user.apply_damage(5, BURN, "l_arm") user.apply_damage(5, BURN, "r_arm") diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 2a5f64915be..115f9319753 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -21,7 +21,6 @@ if(invoke(user)) uses-- if(uses <= 0) - user.drop_item() qdel(src) /obj/item/paper/talisman/proc/invoke(mob/living/user, successfuluse = 1) @@ -182,7 +181,6 @@ C.Jitter(15) if(is_servant_of_ratvar(target)) target.adjustBruteLoss(15) - user.drop_item() qdel(src) return ..() @@ -204,13 +202,13 @@ user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult/alt(user), slot_shoes) user.equip_to_slot_or_del(new /obj/item/storage/backpack/cultpack(user), slot_back) - user.drop_item() + user.dropItemToGround(src) user.put_in_hands(new /obj/item/melee/cultblade(user)) user.put_in_hands(new /obj/item/restraints/legcuffs/bola/cult(user)) /obj/item/paper/talisman/armor/attack(mob/living/target, mob/living/user) if(iscultist(user) && iscultist(target)) - user.drop_item() + user.temporarilyRemoveItemFromInventory(src) invoke(target) qdel(src) return @@ -335,7 +333,6 @@ else to_chat(user, "[C] is already bound.") if(uses <= 0) - user.drop_item() qdel(src) /obj/item/restraints/handcuffs/energy/cult //For the talisman of shackling diff --git a/code/game/gamemodes/devil/true_devil/_true_devil.dm b/code/game/gamemodes/devil/true_devil/_true_devil.dm index 5b85cbd811c..9b24d096c46 100644 --- a/code/game/gamemodes/devil/true_devil/_true_devil.dm +++ b/code/game/gamemodes/devil/true_devil/_true_devil.dm @@ -184,7 +184,7 @@ "[M] has pushed down [src]!") else if (prob(25)) - drop_item() + dropItemToGround(get_active_held_item()) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) visible_message("[M] has disarmed [src]!", \ "[M] has disarmed [src]!") diff --git a/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm b/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm index 879f68e960b..5b5bafdd217 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm @@ -49,7 +49,7 @@ /datum/surgery_step/gland_insert/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] inserts [tool] into [target].", "You insert [tool] into [target].") - user.drop_item() + user.temporarilyRemoveItemFromInventory(tool, TRUE) var/obj/item/organ/heart/gland/gland = tool gland.Insert(target, 2) return 1 diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 5e1d80e1759..e72babc5b00 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -353,7 +353,7 @@ return ..() user.visible_message("[user] scatters [src] in all directions.", \ "You scatter [src] across the area. The particles slowly fade away.") - user.drop_item() + user.dropItemToGround(src) scatter() /obj/item/ectoplasm/revenant/throw_impact(atom/hit_atom) diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index 7aba0adf260..b9a07093d31 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -97,7 +97,7 @@ return user.visible_message("[user]'s eyes flare a deep crimson!", \ "You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!") - user.drop_item() + user.temporarilyRemoveItemFromInventory(src, TRUE) src.Insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E /obj/item/organ/heart/demon/Insert(mob/living/carbon/M, special = 0) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 2179177fc1e..a24efbe3f59 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -91,7 +91,7 @@ to_chat(synd_mind.current, "In your hand you will find a special item capable of triggering a greater challenge for your team. Examine it carefully and consult with your fellow operatives before activating it.") var/obj/item/device/nuclear_challenge/challenge = new /obj/item/device/nuclear_challenge - synd_mind.current.put_in_hands_or_del(challenge) + synd_mind.current.put_in_hands(challenge, TRUE) var/list/foundIDs = synd_mind.current.search_contents_for(/obj/item/card/id) if(foundIDs.len) @@ -110,8 +110,7 @@ P.info = "The nuclear authorization code is: [nuke_code]" P.name = "nuclear bomb code" var/mob/living/carbon/human/H = synd_mind.current - P.forceMove(H.drop_location()) - H.put_in_hands_or_del(P) + H.put_in_hands(P, TRUE) H.update_icons() else nuke_code = "code will be provided later" diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 8870399f248..8cae25eb386 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -105,9 +105,8 @@ /obj/machinery/nuclearbomb/attackby(obj/item/I, mob/user, params) if (istype(I, /obj/item/disk/nuclear)) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) auth = I add_fingerprint(user) return @@ -309,10 +308,8 @@ . = TRUE if("insert_disk") if(!auth) - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/disk/nuclear)) - usr.drop_item() - I.forceMove(src) + var/obj/item/I = usr.is_holding_item_of_type(/obj/item/disk/nuclear) + if(I && usr.transferItemToLoc(I, src)) auth = I . = TRUE if("keypad") diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 42d676c29b2..ced6ebbd35c 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -193,8 +193,8 @@ H.equip_to_slot_or_del(new hat(H), slot_head) H.equip_to_slot_or_del(new /obj/item/clothing/under/roman(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/roman(H), slot_shoes) - H.put_in_hands_or_del(new /obj/item/shield/riot/roman(H)) - H.put_in_hands_or_del(new /obj/item/claymore(H)) + H.put_in_hands(new /obj/item/shield/riot/roman(H), TRUE) + H.put_in_hands(new /obj/item/claymore(H), TRUE) H.equip_to_slot_or_del(new /obj/item/twohanded/spear(H), slot_back) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index d25c7613bca..76c8d0f41cd 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -159,7 +159,7 @@ wizard_mob.equip_to_slot_or_del(new /obj/item/teleportation_scroll(wizard_mob), slot_r_store) var/obj/item/spellbook/spellbook = new /obj/item/spellbook(wizard_mob) spellbook.owner = wizard_mob - wizard_mob.put_in_hands_or_del(spellbook) + wizard_mob.put_in_hands(spellbook, TRUE) to_chat(wizard_mob, "You will find a list of available spells in your spell book. Choose your magic arsenal carefully.") to_chat(wizard_mob, "The spellbook is bound to you, and others cannot use it.") diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index b02ee50c036..00289ee84ba 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -71,15 +71,11 @@ if(storedpda) to_chat(user, "There is already a PDA inside!") return - else - var/obj/item/device/pda/P = user.get_active_held_item() - if(istype(P)) - if(!user.drop_item()) - return - storedpda = P - P.loc = src - P.add_fingerprint(user) - update_icon() + else if(!user.transferItemToLoc(O, src)) + return + storedpda = O + O.add_fingerprint(user) + update_icon() else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) var/obj/item/weldingtool/WT = O diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 7d3c40a0d93..80d50cfb172 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -149,10 +149,10 @@ else if(istype(W, /obj/item/device/analyzer)) if(!isXRay()) - if(!user.drop_item(W)) + if(!user.temporarilyRemoveItemFromInventory(W)) return - upgradeXRay() qdel(W) + upgradeXRay() to_chat(user, "[msg]") else to_chat(user, "[msg2]") diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 1e6fe4c5321..5b828af8208 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -109,11 +109,10 @@ // Upgrades! if(is_type_in_typecache(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already. - if(!user.drop_item(W)) + if(!user.transferItemToLoc(W, src)) return to_chat(user, "You attach \the [W] into the assembly inner circuits.") upgrades += W - W.forceMove(src) return // Taking out upgrades diff --git a/code/game/machinery/computer/gulag_teleporter.dm b/code/game/machinery/computer/gulag_teleporter.dm index ba8fb7914c0..3ea4c2f9b2d 100644 --- a/code/game/machinery/computer/gulag_teleporter.dm +++ b/code/game/machinery/computer/gulag_teleporter.dm @@ -92,18 +92,13 @@ beacon = findbeacon() if("handle_id") if(id) - if(!usr.get_active_held_item()) - usr.put_in_hands(id) - id = null - else - id.forceMove(get_turf(src)) - id = null + usr.put_in_hands(id) + id = null else - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/card/id/prisoner)) - if(!usr.drop_item()) + var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner) + if(I) + if(!usr.transferItemToLoc(I, src)) return - I.forceMove(src) id = I if("set_goal") var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 6ec144d2575..f13cfe8c00d 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -27,9 +27,8 @@ /obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/card/id) && !scan) - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) return - O.loc = src scan = O to_chat(user, "You insert [O].") else @@ -215,17 +214,13 @@ src.temp = null if(href_list["scan"]) if(src.scan) - if(ishuman(usr) && !usr.get_active_held_item()) - usr.put_in_hands(scan) - else - scan.loc = get_turf(src) - src.scan = null + usr.put_in_hands(scan) + scan = null else - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id) + if(I) + if(!usr.transferItemToLoc(I, src)) return - I.loc = src src.scan = I else if(href_list["logout"]) src.authenticated = null diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 620fd514023..3e9d6df42a2 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -90,11 +90,10 @@ if(href_list["id"]) if(href_list["id"] =="insert" && !inserted_id) - var/obj/item/card/id/prisoner/I = usr.get_active_held_item() - if(istype(I)) - if(!usr.drop_item()) + var/obj/item/card/id/prisoner/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner) + if(I) + if(!usr.transferItemToLoc(I, src)) return - I.loc = src inserted_id = I else to_chat(usr, "No valid ID.") diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 1a74c44c30e..7fadcac2f26 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -37,9 +37,8 @@ /obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/card/id)) if(!scan) - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) return - O.loc = src scan = O to_chat(user, "You insert [O].") else @@ -303,17 +302,13 @@ What a mess.*/ if("Confirm Identity") if(scan) - if(ishuman(usr) && !usr.get_active_held_item()) - usr.put_in_hands(scan) - else - scan.loc = get_turf(src) + usr.put_in_hands(scan) scan = null else - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id) + if(I) + if(!usr.transferItemToLoc(I, src)) return - I.loc = src scan = I if("Log Out") diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index 3c183456bed..c44139acfca 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -29,21 +29,19 @@ GLOBAL_LIST_INIT(possible_uplinker_IDs, list("Alfa","Bravo","Charlie","Delta","E ID = rand(1,999) name = "[name] [ID]" -/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params) +/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/I, mob/user, params) if(uplinkholder) to_chat(user, "The [src] already has an uplink in it.") return - if(O.hidden_uplink) - var/obj/item/I = user.get_active_held_item() - if(!user.drop_item()) + if(I.hidden_uplink) + if(!user.transferItemToLoc(I, src)) return uplinkholder = I - I.loc = src I.add_fingerprint(user) update_icon() updateUsrDialog() else - to_chat(user, "The [O] doesn't appear to be an uplink...") + to_chat(user, "[I] doesn't appear to be an uplink...") /obj/machinery/computer/telecrystals/uplinker/update_icon() ..() diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 5e7982a87c7..bde5cda27d6 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -128,12 +128,11 @@ to_chat(user, "The frame needs to be secured first!") return var/obj/item/circuitboard/machine/B = P - if(!user.drop_item()) + if(!user.transferItemToLoc(B, src)) return playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) to_chat(user, "You add the circuit board to the frame.") circuit = B - B.loc = src icon_state = "box_2" state = 3 components = list() @@ -239,10 +238,9 @@ req_components[I] -= used_amt to_chat(user, "You add [P] to [src].") return - if(!user.drop_item()) + if(!user.transferItemToLoc(P, src)) break to_chat(user, "You add [P] to [src].") - P.forceMove(src) components += P req_components[I]-- return 1 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 9e9a449974e..488ffb7379d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1170,10 +1170,9 @@ to_chat(user, "The maintenance panel is destroyed!") return to_chat(user, "You apply [C]. Next time someone opens the door, it will explode.") - user.drop_item() panel_open = FALSE update_icon() - C.forceMove(src) + user.transferItemToLoc(C, src, TRUE) charge = C else if(istype(C, /obj/item/paper) || istype(C, /obj/item/photo)) if(note) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 95adf12875d..542989fa15c 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -426,7 +426,6 @@ return if(constructionStep != CONSTRUCTION_NOCIRCUIT) return - user.drop_item() qdel(C) user.visible_message("[user] adds a circuit to [src].", \ "You insert and secure [C].") diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index f8186a8a511..9bf40542a77 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -63,10 +63,9 @@ else if (istype(W, /obj/item/device/assembly/flash/handheld)) if (!bulb) - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return user.visible_message("[user] installs [W] into [src].", "You install [W] into [src].") - W.forceMove(src) bulb = W power_change() else diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index cbf13abeb97..3b4503c3c85 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -33,9 +33,8 @@ /obj/machinery/gulag_item_reclaimer/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/card/id/prisoner)) if(!inserted_id) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) inserted_id = I to_chat(user, "You insert [I].") return @@ -82,18 +81,13 @@ switch(action) if("handle_id") if(inserted_id) - if(!usr.get_active_held_item()) - usr.put_in_hands(inserted_id) - inserted_id = null - else - inserted_id.forceMove(get_turf(src)) - inserted_id = null + usr.put_in_hands(inserted_id) + inserted_id = null else - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/card/id/prisoner)) - if(!usr.drop_item()) + var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner) + if(I) + if(!usr.transferItemToLoc(I, src)) return - I.forceMove(src) inserted_id = I if("release_items") var/mob/M = locate(params["mobref"]) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 2097b171460..98bef7480b3 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -95,10 +95,8 @@ if(beaker) to_chat(user, "There is already a reagent container loaded!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - - W.forceMove(src) beaker = W to_chat(user, "You attach [W] to [src].") update_icon() diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 204ae83c9d9..863eb3286b9 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -786,11 +786,9 @@ GLOBAL_LIST_EMPTY(allCasters) else qdel(photo) photo = null - if(istype(user.get_active_held_item(), /obj/item/photo)) - photo = user.get_active_held_item() - if(!user.drop_item()) - return - photo.loc = src + photo = user.is_holding_item_of_type(/obj/item/photo) + if(photo && !user.transferItemToLoc(photo, src)) + photo = null if(issilicon(user)) var/list/nametemp = list() var/find diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index cedb94b7b32..26559c5ef9f 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -71,8 +71,6 @@ add_fingerprint(user) if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) to_chat(usr, "You put [W] back into [src].") - if(!user.drop_item()) - return qdel(W) return else if (istype(W, /obj/item/wrench)) diff --git a/code/game/machinery/porta_turret/portable_turret_construct.dm b/code/game/machinery/porta_turret/portable_turret_construct.dm index 7eace086360..ab16ee67ede 100644 --- a/code/game/machinery/porta_turret/portable_turret_construct.dm +++ b/code/game/machinery/porta_turret/portable_turret_construct.dm @@ -84,9 +84,8 @@ if(PTURRET_INTERNAL_ARMOUR_ON) if(istype(I, /obj/item/gun/energy)) //the gun installation part var/obj/item/gun/energy/E = I - if(!user.drop_item()) + if(!user.transferItemToLoc(E, src)) return - E.forceMove(src) installed_gun = E to_chat(user, "You add [I] to the turret.") build_step = PTURRET_GUN_EQUIPPED @@ -101,7 +100,7 @@ if(PTURRET_GUN_EQUIPPED) if(isprox(I)) build_step = PTURRET_SENSORS_ON - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(I)) return to_chat(user, "You add the proximity sensor to the turret.") qdel(I) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 4a72fa90c6d..d373e1267a0 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -50,9 +50,8 @@ to_chat(user, "Your gun has no external power connector.") return 1 - if(!user.drop_item()) + if(!user.transferItemToLoc(G, src)) return 1 - G.loc = src charging = G use_power = ACTIVE_POWER_USE update_icon(scan = TRUE) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 957f533a293..a9162b85f84 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -83,16 +83,15 @@ if(istype(I, /obj/item/coin)) var/obj/item/coin/C = I if(prob(2)) - if(!user.drop_item()) + if(!user.transferItemToLoc(C, drop_location())) return - C.loc = loc C.throw_at(user, 3, 10) if(prob(10)) balance = max(balance - SPIN_PRICE, 0) to_chat(user, "[src] spits your coin back out!") else - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(C)) return to_chat(user, "You insert a [C.cmineral] coin into [src]'s slot!") balance += C.value diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 886798156e4..b45b393ab2d 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -140,18 +140,13 @@ if(cell) to_chat(user, "There is already a power cell inside!") return - else - // insert cell - var/obj/item/stock_parts/cell/C = usr.get_active_held_item() - if(istype(C)) - if(!user.drop_item()) - return - cell = C - C.loc = src - C.add_fingerprint(usr) + else if(!user.transferItemToLoc(I, src)) + return + cell = I + I.add_fingerprint(usr) - user.visible_message("\The [user] inserts a power cell into \the [src].", "You insert the power cell into \the [src].") - SStgui.update_uis(src) + user.visible_message("\The [user] inserts a power cell into \the [src].", "You insert the power cell into \the [src].") + SStgui.update_uis(src) else to_chat(user, "The hatch must be open to insert a power cell!") return diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 7c51c383fab..0854e63e5b6 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -298,32 +298,31 @@ if(suit) to_chat(user, "The unit already contains a suit!.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return suit = I else if(istype(I, /obj/item/clothing/head/helmet)) if(helmet) to_chat(user, "The unit already contains a helmet!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return helmet = I else if(istype(I, /obj/item/clothing/mask)) if(mask) to_chat(user, "The unit already contains a mask!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return mask = I else if(storage) to_chat(user, "The auxiliary storage compartment is full!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return storage = I - I.loc = src visible_message("[user] inserts [I] into [src]", "You load [I] into [src].") update_icon() return diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 24365464a80..acd5f51d3f2 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -150,11 +150,10 @@ to_chat(user, "The cover is screwed on, it won't pry off!") else if(istype(I, /obj/item/bombcore)) if(!payload) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return payload = I to_chat(user, "You place [payload] into [src].") - payload.loc = src else to_chat(user, "[payload] is already loaded into [src]! You'll have to remove it first.") else if(istype(I, /obj/item/weldingtool)) @@ -463,11 +462,10 @@ return else if(istype(I, /obj/item/reagent_containers/glass/beaker) || istype(I, /obj/item/reagent_containers/glass/bottle)) if(beakers.len < max_beakers) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return beakers += I to_chat(user, "You load [src] with [I].") - I.loc = src else to_chat(user, "The [I] wont fit! The [src] can only hold up to [max_beakers] containers.") return diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 0039b2e1e03..7240804d8fc 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -189,9 +189,8 @@ var/obj/item/reagent_containers/food/snacks/S = W if(!S.junkiness) if(!iscompartmentfull(user)) - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src food_load(W) to_chat(user, "You insert [W] into [src]'s chef compartment.") else @@ -279,9 +278,8 @@ if(!premium.len) to_chat(user, "[src] doesn't have a coin slot.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src coin = W to_chat(user, "You insert [W] into [src].") return diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index 7091bfd72a7..a75294c28f3 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -161,7 +161,7 @@ var/obj/item/mecha_parts/mecha_equipment/E = W spawn() if(E.can_attach(src)) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(W)) return E.attach(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src].") @@ -226,11 +226,10 @@ else if(istype(W, /obj/item/stock_parts/cell)) if(state==4) if(!cell) - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return var/obj/item/stock_parts/cell/C = W to_chat(user, "You install the powercell.") - C.forceMove(src) cell = C log_message("Powercell installed") else diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 3f32b18178c..41ba67d6165 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -128,7 +128,7 @@ /obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M) if(..()) - M.drop_item() + M.drop_all_held_items() M.adjustOxyLoss(1) M.emote("cough") return 1 @@ -205,7 +205,6 @@ /obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M) if(..()) - M.drop_item() M.Sleeping(200) M.emote("cough") return 1 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a82b75784cd..96803032d56 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -529,7 +529,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) to_chat(M, "You become nearsighted!") if(prob(50)) if(M.stat != DEAD) - if(M.drop_item()) + if(M.drop_all_held_items()) to_chat(M, "You drop what you're holding and clutch at your eyes!") M.adjust_blurriness(10) M.Unconscious(20) diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 25b1a60955c..4be687a3a01 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -59,7 +59,7 @@ if(target.handcuffed) return - if(!user.drop_item() && !dispense) + if(!user.temporarilyRemoveItemFromInventory(src) && !dispense) return var/obj/item/restraints/handcuffs/cuffs = src @@ -68,7 +68,7 @@ else if(dispense) cuffs = new type() - cuffs.loc = target + cuffs.forceMove(target) target.handcuffed = cuffs target.update_handcuffed() diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index d727c517bdd..cff958926dc 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -233,7 +233,7 @@ /obj/item/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag) if(user && target == user) - user.drop_item() + user.dropItemToGround(src) if(proximity_flag) consume_everything(target) ..() @@ -243,7 +243,7 @@ if(ismob(target)) var/mob/M if(src.loc == M) - M.drop_item() + M.dropItemToGround(src) consume_everything(target) /obj/item/melee/supermatter_sword/pickup(user) @@ -267,7 +267,7 @@ /obj/item/melee/supermatter_sword/suicide_act(mob/user) user.visible_message("[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!") - user.drop_item() + user.dropItemToGround(src, TRUE) shard.CollidedWith(user) /obj/item/melee/supermatter_sword/proc/consume_everything(target) diff --git a/code/game/objects/items/paiwire.dm b/code/game/objects/items/paiwire.dm index 4a75750edf7..994082c5faf 100644 --- a/code/game/objects/items/paiwire.dm +++ b/code/game/objects/items/paiwire.dm @@ -7,8 +7,7 @@ var/obj/machinery/machine /obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user) - if(!user.drop_item()) + if(!user.transferItemToLoc(src, M)) return user.visible_message("[user] inserts [src] into a data port on [M].", "You insert [src] into a data port on [M].", "You hear the satisfying click of a wire jack fastening into place.") - src.loc = M machine = M \ No newline at end of file diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index ad6a7ed1272..8607addb4b3 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -122,7 +122,7 @@ return if(user.disabilities & CLUMSY && prob(75) && clumsyCheck) user.visible_message("[user] loses their grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!") - user.drop_item() + user.dropItemToGround(src, TRUE) if(prob(10)) target = get_turf(user) else diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 3d7b4a96031..f47c5d30eb1 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -254,7 +254,7 @@ if(!isturf(loc)) to_chat(user, "You cannot install[M], the frame has to be standing on the ground to be perfectly precise!") return - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(M)) to_chat(user, "[M] is stuck to your hand!") return qdel(M) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index d8ff523c252..30c881790ca 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -48,7 +48,7 @@ /obj/item/storage/backpack/holding/suicide_act(mob/living/user) user.visible_message("[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.") - user.drop_item() + user.dropItemToGround(src, TRUE) user.Stun(100, ignore_canstun = TRUE) sleep(20) playsound(src, "rustle", 50, 1, -5) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 489f1c6bf07..313988b7d47 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -57,11 +57,9 @@ close_all() to_chat(user, "You fold [src] flat.") - var/obj/item/I = new foldable(get_turf(src)) - user.drop_item() - user.put_in_hands(I) - user.update_inv_hands() + var/obj/item/I = new foldable qdel(src) + user.put_in_hands(I) /obj/item/storage/box/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stack/packageWrap)) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 47ff52811be..706e0aacfb4 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1023,8 +1023,8 @@ throwforce = 12 //pelt your enemies to death with lumps of snow /obj/item/toy/snowball/afterattack(atom/target as mob|obj|turf|area, mob/user) - user.drop_item() - src.throw_at(target, throw_range, throw_speed) + if(user.dropItemToGround(src)) + throw_at(target, throw_range, throw_speed) /obj/item/toy/snowball/throw_impact(atom/hit_atom) if(!..()) @@ -1042,8 +1042,8 @@ w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets /obj/item/toy/beach_ball/afterattack(atom/target as mob|obj|turf|area, mob/user) - user.drop_item() - src.throw_at(target, throw_range, throw_speed) + if(user.dropItemToGround(src)) + throw_at(target, throw_range, throw_speed) /* * Xenomorph action figure diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index cdb0ba9f457..85d124fefc4 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -53,7 +53,7 @@ return if(iscyborg(user)) return - if(!user.drop_item()) + if(!user.drop_all_held_items()) return if (O.loc != src.loc) step(O, get_dir(O, src)) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 9d6985c6208..606b10da0ac 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -58,14 +58,14 @@ playsound(src.loc, W.usesound, 50, 1) deconstruct() else if(istype(W, /obj/item/assembly/shock_kit)) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(W)) return var/obj/item/assembly/shock_kit/SK = W var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) E.setDir(dir) E.part = SK - SK.loc = E + SK.forceMove(E) SK.master = E qdel(src) else diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 68de701967c..f6e2023943d 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -27,7 +27,8 @@ LINEN BINS ..() /obj/item/bedsheet/attack_self(mob/user) - user.drop_item() + if(!user.dropItemToGround(src)) + return if(layer == initial(layer)) layer = ABOVE_MOB_LAYER to_chat(user, "You cover yourself with [src].") @@ -275,18 +276,16 @@ LINEN BINS /obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/bedsheet)) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.loc = src sheets.Add(I) amount++ to_chat(user, "You put [I] in [src].") update_icon() else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) to_chat(user, "\The [I] is stuck to your hand, you cannot hide it among the sheets!") return - I.loc = src hidden = I to_chat(user, "You hide [I] among the sheets.") diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 3d77be1bb53..4e3056f39ae 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -229,8 +229,7 @@ "You cut \the [src] apart with \the [W].") deconstruct(TRUE) return 0 - if(user.drop_item()) // so we put in unlit welder too - W.forceMove(loc) + if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too return 1 else if(istype(W, /obj/item/weldingtool) && can_weld_shut) var/obj/item/weldingtool/WT = W diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index f051c643784..61aab75efc3 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -603,10 +603,9 @@ if(do_after(user, 40, target = src)) if( src.state != 1 ) return - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src to_chat(user, "You install the airlock electronics.") src.state = 2 src.name = "near finished airlock assembly" diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index e61e1a18708..0a3574b1a66 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -54,9 +54,8 @@ return if(istype(I, /obj/item/extinguisher)) if(!stored_extinguisher && opened) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - contents += I stored_extinguisher = I to_chat(user, "You place [I] in [src].") update_icon() diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index 803c4d46278..afcd855caf0 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -53,10 +53,9 @@ if(F.wielded) to_chat(user, "Unwield the [F.name] first.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(F, src)) return fireaxe = F - F.forceMove(src) to_chat(user, "You place the [F.name] back in the [name].") update_icon() return diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 3d7e9be21a6..b3b60228348 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -259,9 +259,8 @@ else if(istype(W, /obj/item/pipe)) var/obj/item/pipe/P = W if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds. - if(!user.drop_item()) + if(!user.transferItemToLoc(P, drop_location())) return - P.loc = src.loc to_chat(user, "You fit the pipe into \the [src].") else return ..() diff --git a/code/game/objects/structures/guncase.dm b/code/game/objects/structures/guncase.dm index 24a6bd4ceb7..ac6a69ed935 100644 --- a/code/game/objects/structures/guncase.dm +++ b/code/game/objects/structures/guncase.dm @@ -39,9 +39,8 @@ return if(istype(I, gun_category) && open) if(LAZYLEN(contents) < capacity) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) to_chat(user, "You place [I] in [src].") update_icon() else diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 58db777abe6..747e0b33173 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -32,9 +32,8 @@ return 1 /obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.loc = src updateUsrDialog() to_chat(user, "You put [I] into [src].") return diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 54730f5f7a3..dd25c652514 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -160,10 +160,9 @@ FLOOR SAFES . = 1 //no afterattack if(I.w_class + space <= maxspace) space += I.w_class - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) to_chat(user, "\The [I] is stuck to your hand, you cannot put it in the safe!") return - I.forceMove(src) to_chat(user, "You put [I] in [src].") updateUsrDialog() return diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index 5d566fdd199..f718649207a 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -104,7 +104,6 @@ "You attach the sign to [T].") playsound(T, 'sound/items/deconstruct.ogg', 50, 1) new sign_path(T) - user.drop_item() qdel(src) else return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 9f1c92d4d31..31521a12da6 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -131,8 +131,7 @@ // If the tray IS empty, continue on (tray will be placed on the table like other items) if(user.a_intent != INTENT_HARM && !(I.flags_1 & ABSTRACT_1)) - if(user.drop_item()) - I.Move(loc) + if(user.transferItemToLoc(I, drop_location())) var/list/click_params = params2list(params) //Center the icon where the user clicked. if(!click_params || !click_params["icon-x"] || !click_params["icon-y"]) @@ -441,7 +440,7 @@ /obj/structure/rack/MouseDrop_T(obj/O, mob/user) if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O)) return - if(!user.drop_item()) + if(!user.dropItemToGround(O)) return if(O.loc != src.loc) step(O, get_dir(O, src)) @@ -454,8 +453,7 @@ return if(user.a_intent == INTENT_HARM) return ..() - if(user.drop_item()) - W.Move(loc) + if(user.transferItemToLoc(W, drop_location())) return 1 /obj/structure/rack/attack_paw(mob/living/user) @@ -518,7 +516,7 @@ building = TRUE to_chat(user, "You start constructing a rack...") if(do_after(user, 50, target = user, progress=TRUE)) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(src)) return var/obj/structure/rack/R = new /obj/structure/rack(user.loc) user.visible_message("[user] assembles \a [R].\ diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 16990103097..076f39b85f0 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -62,9 +62,8 @@ to_chat(user, "[src] can't hold any more of [I].") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.loc = src to_chat(user, "You put [I] in [src].") update_icon() diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index fde6a391c3e..ece2d2cf443 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -23,12 +23,11 @@ /obj/structure/target_stake/attackby(obj/item/target/T, mob/user) if(pinned_target) return - if(istype(T) && user.drop_item()) + if(istype(T) && user.transferItemToLoc(T, drop_location())) pinned_target = T T.pinnedLoc = src T.density = TRUE T.layer = OBJ_LAYER + 0.01 - T.loc = loc to_chat(user, "You slide the target into the stake.") /obj/structure/target_stake/attack_hand(mob/user) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 47aad947418..bb0213ef0bf 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -88,10 +88,9 @@ if(w_items + I.w_class > WEIGHT_CLASS_HUGE) to_chat(user, "The cistern is full!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) to_chat(user, "\The [I] is stuck to your hand, you cannot put it in the cistern!") return - I.loc = src w_items += I.w_class to_chat(user, "You carefully place [I] into the cistern.") @@ -173,10 +172,9 @@ if(I.w_class > 1) to_chat(user, "[I] is too large for the drain enclosure.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) to_chat(user, "\[I] is stuck to your hand, you cannot put it in the drain enclosure!") return - I.forceMove(src) hiddenitem = I to_chat(user, "You place [I] into the drain enclosure.") diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 20c4f18a46d..520ba2ee69f 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -209,11 +209,10 @@ //Adding airlock electronics for access. Step 6 complete. else if(istype(W, /obj/item/electronics/airlock)) - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return playsound(loc, W.usesound, 100, 1) user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly...") - W.loc = src if(do_after(user, 40, target = src)) if(!src || electronics) diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm index 0dd3673f6a4..f0fb7c44480 100644 --- a/code/game/turfs/simulated/floor/light_floor.dm +++ b/code/game/turfs/simulated/floor/light_floor.dm @@ -72,7 +72,7 @@ if(..()) return if(istype(C, /obj/item/light/bulb)) //only for light tiles - if(state && user.drop_item()) + if(state && user.temporarilyRemoveItemFromInventory(C)) qdel(C) state = 0 //fixing it by bashing it with a light bulb, fun eh? update_icon() diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 0dcd6762138..ebd2214aba2 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -89,22 +89,20 @@ var/mob/M = user if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it return - if(!M.drop_item()) //Remove the assembly from your hands + if(!M.temporarilyRemoveItemFromInventory(src)) //Remove the assembly from your hands return - var/obj/item/device/onetankbomb/R = new /obj/item/device/onetankbomb(loc) + var/obj/item/device/onetankbomb/R = new - M.temporarilyRemoveItemFromInventory(src, TRUE) //Remove the tank from your character,in case you were holding it - if(!M.put_in_hands(R)) //Equips the bomb if possible, or puts it on the floor. - forceMove(get_turf(M)) + M.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor. R.bombassembly = S //Tell the bomb about its assembly part S.master = R //Tell the assembly about its new owner - S.loc = R //Move the assembly out of the fucking way + S.forceMove(R) //Move the assembly out of the fucking way R.bombtank = src //Same for tank master = R - loc = R + forceMove(R) R.update_icon() return diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index a3a3796f466..853f422c1c9 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -276,10 +276,9 @@ if(beaker) to_chat(user, "A beaker is already loaded into [src]!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return beaker = I - I.loc = src user.visible_message("[user] places [I] in [src].", \ "You place [I] in [src].") var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list) diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm index 9a2ecb6fea7..96a5b8e4894 100644 --- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm +++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm @@ -80,9 +80,8 @@ if(istype(W, /obj/item/tank)) if(!(stat & BROKEN)) var/obj/item/tank/T = W - if(holding || !user.drop_item()) + if(holding || !user.transferItemToLoc(T, src)) return - T.loc = src holding = T update_icon() else if(istype(W, /obj/item/wrench)) diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm index e960e549f73..f519e567a64 100644 --- a/code/modules/awaymissions/mission_code/Academy.dm +++ b/code/modules/awaymissions/mission_code/Academy.dm @@ -174,7 +174,7 @@ /obj/item/dice/d20/fate/equipped(mob/user, slot) if(!ishuman(user) || !user.mind || (user.mind in SSticker.mode.wizards)) to_chat(user, "You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.") - user.drop_item() + user.dropItemToGround(src) /obj/item/dice/d20/fate/proc/effect(var/mob/living/carbon/human/user,roll) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 985db1947e3..2f6b632ae82 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -592,7 +592,7 @@ BLIND // can't see anything to_chat(user, "[src] already has an accessory.") return else - if(user && !user.drop_item()) + if(user && !user.temporarilyRemoveItemFromInventory(I)) return if(!A.attach(src, user)) return diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index 67fd0171530..63ff85ac17b 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -22,13 +22,10 @@ /obj/item/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = 0) //Creates a shattering noise and replaces the bottle with a broken_bottle - var/new_location = get_turf(loc) + var/new_location = get_turf(src) var/obj/item/broken_bottle/B = new /obj/item/broken_bottle(new_location) - if(ranged) - B.loc = new_location - else - user.drop_item() - user.put_in_active_hand(B) + if(!ranged) + user.put_in_hands(B) B.icon_state = src.icon_state var/icon/I = new('icons/obj/drinks.dmi', src.icon_state) diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index 0f27265b4b6..df323a99ff7 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -58,10 +58,9 @@ insert ascii eagle on american flag background here else if(is_type_in_typecache(I, deepfry_blacklisted_items)) . = ..() - else if(user.drop_item() && !frying) + else if(!frying && user.transferItemToLoc(I, src)) to_chat(user, "You put [I] into [src].") frying = I - frying.forceMove(src) icon_state = "fryer_on" /obj/machinery/deepfryer/process() diff --git a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm index ee296900272..d6037af55b0 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm @@ -68,8 +68,6 @@ if(istype(O, /obj/item/reagent_containers/food/drinks/drinkingglass)) var/obj/item/reagent_containers/food/drinks/drinkingglass/DG = O if(!DG.reagents.total_volume) //glass is empty - if(!user.drop_item()) - return qdel(DG) glasses++ to_chat(user, "The [src] accepts the drinking glass, sterilizing it.") @@ -78,9 +76,8 @@ to_chat(user, "The [src] is at full capacity.") else var/obj/item/reagent_containers/food/snacks/S = O - if(!user.drop_item()) + if(!user.transferItemToLoc(S, src)) return - S.loc = src if(stored_food[sanitize(S.name)]) stored_food[sanitize(S.name)]++ else diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index e25b29f7216..fd2471b96eb 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -142,11 +142,10 @@ to_chat(user, "[src] is full, you can't put anything in!") return 1 else - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) to_chat(user, "\the [O] is stuck to your hand, you cannot put it in \the [src]!") return 0 - O.loc = src user.visible_message( \ "[user] has added \the [O] to \the [src].", \ "You add \the [O] to \the [src].") diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index 6e245bd3865..fb871f2c3a4 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -195,8 +195,7 @@ if(P) user.visible_message("[user] put [O] into [src].", \ "You put [O] into [src].") - user.drop_item() - O.loc = src + user.transferItemToLoc(O, src, TRUE) return 1 else if(user.a_intent != INTENT_HARM) diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index 82fcc8c5389..6788d1fc924 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -178,20 +178,18 @@ if(pizza) to_chat(user, "[src] already has \a [pizza.name]!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return pizza = I - I.loc = src to_chat(user, "You put [I] in [src].") update_icon() return else if(istype(I, /obj/item/bombcore/pizza)) if(open && !bomb) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return wires = new /datum/wires/explosive/pizza(src) bomb = I - I.loc = src to_chat(user, "You put [I] in [src]. Sneeki breeki...") update_icon() return diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index 736a6732a00..1073f0d898e 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -104,7 +104,7 @@ /obj/structure/holohoop/attackby(obj/item/W as obj, mob/user as mob, params) if(get_dist(src,user)<2) - if(user.drop_item(src)) + if(user.transferItemToLoc(W, drop_location())) visible_message(" [user] dunks [W] into \the [src]!") /obj/structure/holohoop/attack_hand(mob/user) @@ -211,9 +211,7 @@ /obj/machinery/conveyor/holodeck /obj/machinery/conveyor/holodeck/attackby(obj/item/I, mob/user, params) - if(user.drop_item()) - I.loc = src.loc - else + if(!user.transferItemToLoc(I, drop_location())) return ..() /obj/item/paper/fluff/holodeck/trek_diploma diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 5c9b0dac5ed..1535173f8d4 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -95,9 +95,8 @@ if(beaker) to_chat(user, "A container is already loaded into the machine.") else - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) return - O.loc = src beaker = O to_chat(user, "You add the container to the machine.") update_icon() diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index 9439346bba4..de881a0611c 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -80,7 +80,7 @@ if(seed) to_chat(user, "A sample is already loaded into the machine!") else - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory()) return insert_seed(I) to_chat(user, "You add [I] to the machine.") @@ -90,10 +90,9 @@ if(disk) to_chat(user, "A data disk is already loaded into the machine!") else - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return disk = I - disk.loc = src to_chat(user, "You add [I] to the machine.") interact(user) else @@ -269,7 +268,7 @@ else var/obj/item/I = usr.get_active_held_item() if (istype(I, /obj/item/seeds)) - if(!usr.drop_item()) + if(!usr.temporarilyRemoveItemFromInventory(I)) return insert_seed(I) to_chat(usr, "You add [I] to the machine.") @@ -283,10 +282,9 @@ else var/obj/item/I = usr.get_active_held_item() if(istype(I, /obj/item/disk/plantgene)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(I, src)) return disk = I - disk.loc = src to_chat(usr, "You add [I] to the machine.") else if(href_list["op"] == "insert" && disk && disk.gene && seed) if(!operation) // Wait for confirmation diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm index 5e327015268..7834ed15e82 100644 --- a/code/modules/hydroponics/grown/cereals.dm +++ b/code/modules/hydroponics/grown/cereals.dm @@ -87,8 +87,7 @@ /obj/item/reagent_containers/food/snacks/grown/meatwheat/attack_self(mob/living/user) user.visible_message("[user] crushes [src] into meat.", "You crush [src] into something that resembles meat.") playsound(user, 'sound/effects/blobattack.ogg', 50, 1) - var/obj/item/reagent_containers/food/snacks/meat/slab/meatwheat/M = new(get_turf(user)) - user.drop_item() + var/obj/item/reagent_containers/food/snacks/meat/slab/meatwheat/M = new qdel(src) user.put_in_hands(M) return 1 diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm index b32fa12a133..485ab6bfd85 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -115,4 +115,4 @@ if(prob(20)) M.Unconscious(force / 0.3) M.Knockdown(force / 0.75) - M.drop_item() + M.drop_all_held_items() diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index cba3406a771..54805f3141b 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -13,7 +13,7 @@ if(istype(O, /obj/item/reagent_containers/food/snacks/grown/)) var/obj/item/reagent_containers/food/snacks/grown/F = O if(F.seed) - if(user && !user.drop_item()) //couldn't drop the item + if(user && !user.temporarilyRemoveItemFromInventory(O)) //couldn't drop the item return while(t_amount < t_max) var/obj/item/seeds/t_prod = F.seed.Copy() @@ -25,7 +25,7 @@ else if(istype(O, /obj/item/grown)) var/obj/item/grown/F = O if(F.seed) - if(user && !user.drop_item()) + if(user && !user.temporarilyRemoveItemFromInventory(O)) return while(t_amount < t_max) var/obj/item/seeds/t_prod = F.seed.Copy() @@ -181,13 +181,12 @@ if(ismob(O.loc)) var/mob/M = O.loc - if(!M.drop_item()) + if(!M.transferItemToLoc(O, src)) return 0 else if(istype(O.loc, /obj/item/storage)) var/obj/item/storage/S = O.loc S.remove_from_storage(O,src) - O.loc = src . = 1 for (var/datum/seed_pile/N in piles) if (O.plantname == N.name && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 33f02bc7593..711ac4f33af 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -84,9 +84,8 @@ if(2) if(is_type_in_list(I, allowed_books)) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.loc = src update_icon() else if(istype(I, /obj/item/storage/bag/books)) var/obj/item/storage/bag/books/B = I diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index dc48bbae2d5..081ecdcdaa5 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -507,9 +507,8 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums /obj/machinery/libraryscanner/attackby(obj/O, mob/user, params) if(istype(O, /obj/item/book)) - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) return - O.loc = src else return ..() @@ -576,9 +575,8 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums if(busy) to_chat(user, "The book binder is busy. Please wait for completion of previous operation.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(P, src)) return - P.loc = src user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].") audible_message("[src] begins to hum as it warms up its printing drums.") busy = TRUE diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index d419ce7e38b..d76278a4104 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -67,8 +67,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) B.handle_item_insertion(src) uses_left-- if(uses_left <= 0) - user.drop_item(src) - loc = A + user.transferItemToLoc(src, A, TRUE) var/mutable_appearance/balloon var/mutable_appearance/balloon2 var/mutable_appearance/balloon3 diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 7c16f2f4203..12c9bfb30e5 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -24,9 +24,8 @@ /obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/card/id/prisoner)) if(!inserted_id) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) inserted_id = I to_chat(user, "You insert [I].") return @@ -83,9 +82,8 @@ else var/obj/item/I = usr.get_active_held_item() if(istype(I, /obj/item/card/id/prisoner)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(I, src)) return - I.forceMove(src) inserted_id = I if("claim_points") inserted_id.points += stacking_machine.points diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 406d4444a81..5ab687cc665 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -1005,7 +1005,7 @@ if(H == L) continue to_chat(H, "You have an overwhelming desire to kill [L]. [L.p_they(TRUE)] [L.p_have()] been marked red! Go kill [L.p_them()]!") - H.put_in_hands_or_del(new /obj/item/kitchen/knife/butcher(H)) + H.put_in_hands(new /obj/item/kitchen/knife/butcher(H), TRUE) qdel(src) diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 38e02474f4b..437073a1fcd 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -166,9 +166,8 @@ if(istype(W, /obj/item/card/id)) var/obj/item/card/id/I = user.get_active_held_item() if(istype(I) && !istype(inserted_id)) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) inserted_id = I interact(user) return diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 8ae3632d340..5a228973cee 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -116,9 +116,8 @@ else if(href_list["choice"] == "insert") var/obj/item/card/id/I = usr.get_active_held_item() if(istype(I)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(I, src)) return - I.loc = src inserted_id = I to_chat(usr, "You insert the ID into [src]'s card slot.") else @@ -155,9 +154,8 @@ if(istype(I, /obj/item/card/id)) var/obj/item/card/id/C = usr.get_active_held_item() if(istype(C) && !istype(inserted_id)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(C, src)) return - C.loc = src inserted_id = C to_chat(usr, "You insert the ID into [src]'s card slot.") interact(user) diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index 2836bd67f83..17c89b3af99 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -11,9 +11,7 @@ /obj/structure/ore_box/attackby(obj/item/W, mob/user, params) if (istype(W, /obj/item/ore)) - if(!user.drop_item()) - return - W.forceMove(src) + user.transferItemToLoc(W, src) else if (istype(W, /obj/item/storage)) var/obj/item/storage/S = W for(var/obj/item/ore/O in S.contents) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 59e7db1286f..486a918c064 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -222,26 +222,10 @@ I.dropped(src) return FALSE - -/mob/proc/put_in_hands_or_del(obj/item/I) - return put_in_hands(I, TRUE) - - -/mob/proc/drop_item_v() //this is dumb. - if(stat == CONSCIOUS && isturf(loc)) - return drop_item() - return FALSE - - /mob/proc/drop_all_held_items() + . = FALSE for(var/obj/item/I in held_items) - dropItemToGround(I) - -//Drops the item in our active hand. -/mob/proc/drop_item() - var/obj/item/held = get_active_held_item() - return dropItemToGround(held) - + . |= dropItemToGround(I) //Here lie drop_from_inventory and before_item_take, already forgotten and not missed. diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index aa15e28e66d..6ac5ab1bada 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -115,9 +115,8 @@ //since these people will be dead M != usr if(!C.getorgan(/obj/item/organ/brain)) - if(!C.get_bodypart("head")) + if(!C.get_bodypart("head") || !C.temporarilyRemoveItemFromInventory(src)) return - user.drop_item() var/msg = "[C] has [src] inserted into [C.p_their()] head by [user]." if(C == user) msg = "[user] inserts [src] into [user.p_their()] head!" diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm index a09734ff494..36ed5ec8840 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm @@ -51,7 +51,7 @@ "[M] has pushed down [src]!") else if (prob(50)) - drop_item() + dropItemToGround(get_active_held_item()) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) visible_message("[M] has disarmed [src]!", \ "[M] has disarmed [src]!", null, COMBAT_MESSAGE_RANGE) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7f7f9c1a8aa..323af207b59 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -204,7 +204,7 @@ return 0 if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stunned instead. - if(get_active_held_item() && drop_item()) + if(dropItemToGround(get_active_held_item())) playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) visible_message("[M] disarmed [src]!", \ "[M] disarmed [src]!") @@ -256,7 +256,7 @@ apply_damage(damage, BRUTE, affecting, armor_block) if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stun instead. - if(get_active_held_item() && drop_item()) + if(dropItemToGround(get_active_held_item())) playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) visible_message("[M] disarmed [src]!", \ "[M] disarmed [src]!") diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm index 404610c73ec..afa167ced63 100644 --- a/code/modules/mob/living/carbon/human/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive.dm @@ -657,7 +657,7 @@ insert_into_backpack() //---------FASHION if(istype(TARGET, /obj/item/clothing)) - drop_item() + temporarilyRemoveItemFromInventory(TARGET, TRUE) dressup(TARGET) update_hands = 1 if(MYPDA in src.loc || MYID in src.loc) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index ec22a5bb0c5..88fb3499fb4 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1198,7 +1198,7 @@ target.stop_pulling() else I = target.get_active_held_item() - if(target.drop_item()) + if(target.dropItemToGround(I)) target.visible_message("[user] has disarmed [target]!", \ "[user] has disarmed [target]!", null, COMBAT_MESSAGE_RANGE) else diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index 20054d16bcd..e51017d8992 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -69,11 +69,9 @@ add_logs(M, src, "pushed") visible_message("[M] has pushed down [src]!", \ "[M] has pushed down [src]!", null, COMBAT_MESSAGE_RANGE) - else - if(drop_item()) - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - visible_message("[M] has disarmed [src]!", \ - "[M] has disarmed [src]!", null, COMBAT_MESSAGE_RANGE) + else if(dropItemToGround(get_active_held_item())) + playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + visible_message("[M] has disarmed [src]!", "[M] has disarmed [src]!", null, COMBAT_MESSAGE_RANGE) /mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M) if(..()) //if harm or disarm intent. @@ -113,12 +111,10 @@ "[M] has tackled down [name]!", null, COMBAT_MESSAGE_RANGE) else I = get_active_held_item() - if(drop_item()) - visible_message("[M] has disarmed [name]!", \ - "[M] has disarmed [name]!", null, COMBAT_MESSAGE_RANGE) + if(dropItemToGround(I)) + visible_message("[M] has disarmed [name]!", "[M] has disarmed [name]!", null, COMBAT_MESSAGE_RANGE) else - I = null//did not manage to actually disarm the item, gross but no time to refactor - + I = null add_logs(M, src, "disarmed", "[I ? " removing \the [I]" : ""]") updatehealth() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 381c9988654..3b7950df5e9 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -424,9 +424,8 @@ else if(cell) to_chat(user, "There is a power cell already installed!") else - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src cell = W to_chat(user, "You insert the power cell.") update_icons() @@ -515,7 +514,7 @@ else if(U.locked) to_chat(user, "The upgrade is locked and cannot be used yet!") else - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(U)) return if(U.action(src)) to_chat(user, "You apply the upgrade to [src].") @@ -526,12 +525,13 @@ upgrades += U else to_chat(user, "Upgrade error.") + U.forceMove(drop_location()) else if(istype(W, /obj/item/device/toner)) if(toner >= tonermax) to_chat(user, "The toner level of [src] is at its highest level possible!") else - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(W)) return toner = tonermax qdel(W) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 3e053b80af7..46a62a1d509 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -142,9 +142,6 @@ for(var/key in alarm_types_clear) alarm_types_clear[key] = 0 -/mob/living/silicon/drop_item() - return - /mob/living/silicon/can_inject(mob/user, error_msg) if(error_msg) to_chat(user, "Their outer shell is too tough.") diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 1afcdaaed4b..98b1b46ed8c 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -846,9 +846,8 @@ Pass a positive integer as an argument to override a bot's default speed. else if(allow_pai && !key) if(!locked && !open) if(card.pai && card.pai.mind) - if(!user.drop_item()) + if(!user.transferItemToLoc(card, src)) return - card.forceMove(src) paicard = card user.visible_message("[user] inserts [card] into [src]!","You insert [card] into [src].") paicard.pai.mind.transfer_to(src) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index bbbe4e310c0..3a46e46bebb 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -223,10 +223,9 @@ if(!isnull(reagent_glass)) to_chat(user, "There is already a beaker loaded!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src reagent_glass = W to_chat(user, "You insert [W].") show_controls(user) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 69d53594f20..c2cc13fb630 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -84,11 +84,9 @@ if(open) on = FALSE else if(istype(I, /obj/item/stock_parts/cell) && open && !cell) - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - var/obj/item/stock_parts/cell/C = I - C.loc = src - cell = C + cell = I visible_message("[user] inserts a cell into [src].", "You insert the new cell into [src].") else if(istype(I, /obj/item/crowbar) && open && cell) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 9e595bc2095..2544167752a 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -174,7 +174,7 @@ usr.visible_message("[usr] pets [src].","You rest your hand on [src]'s back for a moment.") return - if(!usr.drop_item()) + if(!usr.temporarilyRemoveItemFromInventory(item_to_add)) to_chat(usr, "\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s back!") return @@ -189,7 +189,7 @@ if(!allowed) to_chat(usr, "You set [item_to_add] on [src]'s back, but it falls off!") - item_to_add.loc = loc + item_to_add.forceMove(drop_location()) if(prob(25)) step_rand(item_to_add) for(var/i in list(1,2,4,8,4,8,4,dir)) @@ -197,8 +197,7 @@ sleep(1) return - usr.drop_item() - item_to_add.loc = src + item_to_add.forceMove(src) src.inventory_back = item_to_add update_corgi_fluff() regenerate_icons() @@ -226,7 +225,7 @@ user.visible_message("[user] pets [src].","You rest your hand on [src]'s head for a moment.") return - if(user && !user.drop_item()) + if(user && !user.temporarilyRemoveItemFromInventory(item_to_add)) to_chat(user, "\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!") return 0 @@ -243,13 +242,13 @@ user.visible_message("[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once.", "You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks.", "You hear a friendly-sounding bark.") - item_to_add.loc = src + item_to_add.forceMove(src) src.inventory_head = item_to_add update_corgi_fluff() regenerate_icons() else to_chat(user, "You set [item_to_add] on [src]'s head, but it falls off!") - item_to_add.loc = loc + item_to_add.forceMove(drop_location()) if(prob(25)) step_rand(item_to_add) for(var/i in list(1,2,4,8,4,8,4,dir)) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 0f8689b8514..f92bee5b3e8 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -268,7 +268,6 @@ if(!stat && eggsleft < 8) var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]" user.visible_message(feedmsg) - user.drop_item() qdel(O) eggsleft += rand(1, 4) else diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index fc2cf729d7b..5f54710d8da 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -244,8 +244,8 @@ var/obj/item/device/radio/headset/headset_to_add = item_to_add - usr.drop_item() - headset_to_add.loc = src + if(!usr.transferItemToLoc(headset_to_add, src)) + return src.ears = headset_to_add to_chat(usr, "You fit the headset onto [src].") @@ -338,7 +338,6 @@ drop_held_item(0) else if(istype(O, /obj/item/reagent_containers/food/snacks/cracker)) //Poly wants a cracker. qdel(O) - user.drop_item() if(health < maxHealth) adjustBruteLoss(-10) speak_chance *= 1.27 // 20 crackers to go from 1% to 100% diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 4da630bb31f..a66b45d4a21 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -53,10 +53,11 @@ /client/Northwest() - if(!usr.get_active_held_item()) + var/obj/item/I = usr.get_active_held_item() + if(!I) to_chat(usr, "You have nothing to drop in your hand!") return - usr.drop_item() + usr.dropItemToGround(I) //This gets called when you press the delete button. /client/verb/delete_key_pressed() @@ -85,8 +86,8 @@ /client/verb/drop_item() set hidden = 1 - if(!iscyborg(mob)) - mob.drop_item_v() + if(!iscyborg(mob) && mob.stat == CONSCIOUS) + mob.dropItemToGround(mob.get_active_held_item()) return diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index ead6a35eeaa..0562bf700df 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -175,9 +175,8 @@ else var/obj/item/I = usr.get_active_held_item() if (istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(I, computer)) return - I.forceMove(computer) card_slot.stored_card = I if("auth") if(auth_card) @@ -191,9 +190,8 @@ else var/obj/item/I = usr.get_active_held_item() if (istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + if(!usr.transferItemToLoc(I, computer)) return - I.forceMove(computer) card_slot.stored_card2 = I if("PRG_terminate") if(computer && ((id_card.assignment in head_subordinates) || id_card.assignment == "Assistant")) diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index adec1aa19d2..99eb6f1a238 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -244,7 +244,7 @@ if(istype(I, /obj/item/stack/spacecash)) var/obj/item/stack/spacecash/c = I - if(!user.drop_item(c)) + if(!user.temporarilyRemoveItemFromInventory(c)) return credits += c.value visible_message("[usr] inserts [c.value] credits into the [src].") diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 3eac093f1b3..22fe9a75a99 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -47,10 +47,9 @@ /obj/structure/filingcabinet/attackby(obj/item/P, mob/user, params) if(istype(P, /obj/item/paper) || istype(P, /obj/item/folder) || istype(P, /obj/item/photo) || istype(P, /obj/item/documents)) - if(!user.drop_item()) + if(!user.transferItemToLoc(P, src)) return to_chat(user, "You put [P] in [src].") - P.loc = src icon_state = "[initial(icon_state)]-open" sleep(5) icon_state = initial(icon_state) diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm index 2c704b8568b..4a85d03df76 100644 --- a/code/modules/paperwork/paper_cutter.dm +++ b/code/modules/paperwork/paper_cutter.dm @@ -44,16 +44,15 @@ /obj/item/papercutter/attackby(obj/item/P, mob/user, params) if(istype(P, /obj/item/paper) && !storedpaper) - if(!user.drop_item()) + if(!user.transferItemToLoc(P, src)) return playsound(loc, "pageturn", 60, 1) to_chat(user, "You place [P] in [src].") - P.loc = src storedpaper = P update_icon() return if(istype(P, /obj/item/hatchet/cutterblade) && !storedcutter) - if(!user.drop_item()) + if(!user.transferItemToLoc(P, src)) return to_chat(user, "You replace [src]'s [P].") P.loc = src diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 0dcd5d09a0e..d4e78c4ef3c 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -240,7 +240,7 @@ updateUsrDialog() /obj/machinery/photocopier/proc/do_insertion(obj/item/O, mob/user) - O.loc = src + O.forceMove(src) to_chat(user, "You insert [O] into [src].") flick("photocopier1", src) updateUsrDialog() @@ -261,7 +261,7 @@ resistance_flags |= FLAMMABLE fire_act() else - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(O)) return copy = O do_insertion(O, user) @@ -270,7 +270,7 @@ else if(istype(O, /obj/item/photo)) if(copier_empty()) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(O)) return photocopy = O do_insertion(O, user) @@ -279,7 +279,7 @@ else if(istype(O, /obj/item/documents)) if(copier_empty()) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(O)) return doccopy = O do_insertion(O, user) @@ -288,7 +288,7 @@ else if(istype(O, /obj/item/device/toner)) if(toner <= 0) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(O)) return qdel(O) toner = 40 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 056be0d0e2b..89b409dfe40 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -449,9 +449,8 @@ if (stat & MAINT) to_chat(user, "There is no connector for your power cell!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.forceMove(src) cell = W user.visible_message(\ "[user.name] has inserted the power cell to [src.name]!",\ diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 9943170f783..2b7fe06e05a 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -315,7 +315,7 @@ src.add_fingerprint(user) var/obj/item/light/L = W if(istype(L, light_type)) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory()) return src.add_fingerprint(user) diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 8399f73e79d..9b5592af3b0 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -87,10 +87,9 @@ GLOBAL_LIST_EMPTY(rad_collectors) if(loaded_tank) to_chat(user, "There's already a plasma tank loaded!") return TRUE - if(!user.drop_item()) - return TRUE + if(!user.transferItemToLoc(W, src)) + return loaded_tank = W - W.forceMove(src) update_icons() else if(istype(W, /obj/item/crowbar)) if(loaded_tank) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index dcc8c0a2007..fb530f128fc 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -240,7 +240,7 @@ if(!tracker) if(istype(W, /obj/item/electronics/tracker)) - if(!user.drop_item()) + if(!user.temporarilyRemoveItemFromInventory(W)) return tracker = 1 qdel(W) diff --git a/code/modules/projectiles/box_magazine.dm b/code/modules/projectiles/box_magazine.dm index 29e27d18ba5..324470ede40 100644 --- a/code/modules/projectiles/box_magazine.dm +++ b/code/modules/projectiles/box_magazine.dm @@ -81,8 +81,7 @@ if(istype(A, /obj/item/ammo_casing)) var/obj/item/ammo_casing/AC = A if(give_round(AC, replace_spent)) - user.drop_item() - AC.forceMove(src) + user.transferItemToLoc(AC, src, TRUE) num_loaded++ if(num_loaded) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index e5767e48baf..564bcd04d81 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -164,7 +164,7 @@ to_chat(user, "You shoot yourself in the foot with [src]!") var/shot_leg = pick("l_leg", "r_leg") process_fire(user,user,0,params, zone_override = shot_leg) - user.drop_item() + user.dropItemToGround(src, TRUE) return if(weapon_weight == WEAPON_HEAVY && user.get_inactive_held_item()) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 833c6cb7304..584445a5736 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -358,5 +358,5 @@ if(process_fire(user, user, 0, zone_override = "head")) user.visible_message("[user] somehow manages to shoot [user.p_them()]self in the face!", "You somehow shoot yourself in the face! How the hell?!") user.emote("scream") - user.drop_item() + user.drop_all_held_items() user.Knockdown(80) diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 730c1969e82..105e1704290 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -172,11 +172,11 @@ if(guns_left) var/obj/item/gun/ballistic/shotgun/boltaction/enchanted/GUN = new gun_type GUN.guns_left = guns_left - 1 - user.drop_item() + user.dropItemToGround(src, TRUE) user.swap_hand() user.put_in_hands(GUN) else - user.drop_item() + user.dropItemToGround(src, TRUE) discard_gun(user) // Automatic Shotguns// diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm index 5ee2ecec053..8772ae05c05 100644 --- a/code/modules/projectiles/guns/misc/blastcannon.dm +++ b/code/modules/projectiles/guns/misc/blastcannon.dm @@ -49,12 +49,11 @@ if(!T.tank_one || !T.tank_two) to_chat(user, "What good would an incomplete bomb do?") return FALSE - if(!user.drop_item(O)) + if(!user.transferItemToLoc(O, src)) to_chat(user, "The [O] seems to be stuck to your hand!") return FALSE user.visible_message("[user] attaches the [O] to the [src]!") bomb = O - O.forceMove(src) update_icon() return TRUE return ..() diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 21b5a2b07f8..60d1f647547 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -190,9 +190,7 @@ M.emote("laugh") if(prob(33)) M.visible_message("[M]'s hands flip out and flail everywhere!") - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() ..() M.adjustToxLoss(1, 0) M.adjustBrainLoss(pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) @@ -269,9 +267,7 @@ if(prob(20)) M.emote(pick("twitch","drool","moan")) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() ..() /datum/reagent/drug/bath_salts/addiction_act_stage1(mob/living/M) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 72001d5ca9d..f1b076ca686 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -256,7 +256,6 @@ victim.confused = max(M.confused, 3) victim.damageoverlaytemp = 60 victim.Knockdown(60) - victim.drop_item() return else if ( eyes_covered ) // Eye cover is better than mouth cover victim.blur_eyes(3) @@ -270,7 +269,6 @@ victim.confused = max(M.confused, 6) victim.damageoverlaytemp = 75 victim.Knockdown(100) - victim.drop_item() victim.update_damage_hud() /datum/reagent/consumable/condensedcapsaicin/on_mob_life(mob/living/M) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 38f3d68eff8..aa85a9dfaf8 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -626,27 +626,20 @@ /datum/reagent/medicine/morphine/overdose_process(mob/living/M) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() M.Dizzy(2) M.Jitter(2) ..() /datum/reagent/medicine/morphine/addiction_act_stage1(mob/living/M) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() - M.Dizzy(2) + M.drop_all_held_items() M.Jitter(2) ..() /datum/reagent/medicine/morphine/addiction_act_stage2(mob/living/M) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() M.adjustToxLoss(1*REM, 0) . = 1 M.Dizzy(3) @@ -655,9 +648,7 @@ /datum/reagent/medicine/morphine/addiction_act_stage3(mob/living/M) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() M.adjustToxLoss(2*REM, 0) . = 1 M.Dizzy(4) @@ -666,9 +657,7 @@ /datum/reagent/medicine/morphine/addiction_act_stage4(mob/living/M) if(prob(33)) - var/obj/item/I = M.get_active_held_item() - if(I) - M.drop_item() + M.drop_all_held_items() M.adjustToxLoss(3*REM, 0) . = 1 M.Dizzy(5) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 49e375b7231..2a194ee95c4 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -141,8 +141,7 @@ to_chat(user, "You reverse [src]'s direction.") else if(user.a_intent != INTENT_HARM) - if(user.drop_item()) - I.loc = src.loc + user.transferItemToLoc(I, drop_location()) else return ..() diff --git a/code/modules/recycling/disposal-unit.dm b/code/modules/recycling/disposal-unit.dm index 351e9a67613..b73ec3d009d 100644 --- a/code/modules/recycling/disposal-unit.dm +++ b/code/modules/recycling/disposal-unit.dm @@ -96,7 +96,7 @@ return if(user.a_intent != INTENT_HARM) - if(!user.drop_item() || (I.flags_1 & ABSTRACT_1)) + if((I.flags_1 & ABSTRACT_1) || !user.temporarilyRemoveItemFromInventory(I)) return place_item_in_disposal(I, user) update_icon() diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 5d3cde7aac9..790cba08896 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -43,12 +43,11 @@ Note: Must be placed within 3 tiles of the R&D Console if (temp_tech.len == 0) to_chat(user, "You cannot deconstruct this item!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) to_chat(user, "\The [O] is stuck to your hand, you cannot put it in the [src.name]!") return busy = TRUE loaded_item = O - O.forceMove(src) to_chat(user, "You add the [O.name] to the [src.name]!") flick("d_analyzer_la", src) addtimer(CALLBACK(src, .proc/finish_loading), 10) diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 4d8938b1b8a..3a2b1f6b7fa 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -122,10 +122,9 @@ if (temp_tech.len == 0) to_chat(user, "You cannot experiment on this item!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(O, src)) return loaded_item = O - O.loc = src to_chat(user, "You add the [O.name] to the machine.") flick("h_lathe_load", src) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index bfe7970e9f8..d912bc908e7 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -127,9 +127,8 @@ won't update every console in existence) but it's more of a hassle to do. Also, else to_chat(user, "Machine cannot accept disks in that format.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(D, src)) return - D.loc = src to_chat(user, "You add the disk to the machine!") else if(!(linked_destroy && linked_destroy.busy) && !(linked_lathe && linked_lathe.busy) && !(linked_imprinter && linked_imprinter.busy)) . = ..() diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 1be515f1774..02180b273fc 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -70,7 +70,6 @@ if(istype(O, /obj/item/reagent_containers/food/snacks/monkeycube)) monkeys++ to_chat(user, "You feed [O] to [src]. It now has [monkeys] monkey cubes stored.") - user.drop_item() qdel(O) return else if(istype(O, /obj/item/storage/bag)) diff --git a/code/modules/spells/spell_types/conjure.dm b/code/modules/spells/spell_types/conjure.dm index 08837c956dc..c73c5de58a2 100644 --- a/code/modules/spells/spell_types/conjure.dm +++ b/code/modules/spells/spell_types/conjure.dm @@ -75,9 +75,8 @@ item = null else for(var/mob/living/carbon/C in targets) - if(C.drop_item()) - item = make_item() - C.put_in_hands(item) + if(C.dropItemToGround(C.get_active_held_item())) + C.put_in_hands(make_item(), TRUE) /obj/effect/proc_holder/spell/targeted/conjure_item/Destroy() if(item) diff --git a/code/modules/spells/spell_types/devil.dm b/code/modules/spells/spell_types/devil.dm index 9d1afdcebc6..b1867413a3c 100644 --- a/code/modules/spells/spell_types/devil.dm +++ b/code/modules/spells/spell_types/devil.dm @@ -49,7 +49,7 @@ for(var/mob/living/carbon/C in targets) if(C.mind && user.mind) if(C.stat == DEAD) - if(user.drop_item()) + if(user.dropItemToGround(user.get_active_held_item())) var/obj/item/paper/contract/infernal/revive/contract = new(user.loc, C.mind, user.mind) user.put_in_hands(contract) else diff --git a/code/modules/spells/spell_types/devil_boons.dm b/code/modules/spells/spell_types/devil_boons.dm index a0be169d85c..5d335745d2b 100644 --- a/code/modules/spells/spell_types/devil_boons.dm +++ b/code/modules/spells/spell_types/devil_boons.dm @@ -14,7 +14,7 @@ /obj/effect/proc_holder/spell/targeted/summon_wealth/cast(list/targets, mob/user = usr) for(var/mob/living/carbon/C in targets) - if(user.drop_item()) + if(user.dropItemToGround(user.get_active_held_item())) var/obj/item = pick( new /obj/item/coin/gold(user.loc), new /obj/item/coin/diamond(user.loc), diff --git a/code/modules/spells/spell_types/infinite_guns.dm b/code/modules/spells/spell_types/infinite_guns.dm index 6036d1a70bb..feb6eeddb6b 100644 --- a/code/modules/spells/spell_types/infinite_guns.dm +++ b/code/modules/spells/spell_types/infinite_guns.dm @@ -14,12 +14,9 @@ /obj/effect/proc_holder/spell/targeted/infinite_guns/cast(list/targets, mob/user = usr) for(var/mob/living/carbon/C in targets) - C.drop_item() - C.swap_hand() - C.drop_item() + C.drop_all_held_items() var/GUN = new summon_path C.put_in_hands(GUN) - C.swap_hand(C.get_held_index_of_item(GUN)) /obj/effect/proc_holder/spell/targeted/infinite_guns/gun diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index a37502a96ba..8bad429102a 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -29,9 +29,8 @@ return 0 else user.visible_message("[user] stuffs [tool] into [target]'s [target_zone]!", "You stuff [tool] into [target]'s [target_zone].") - user.drop_item() + user.transferItemToLoc(tool, target, TRUE) CH.cavity_item = tool - tool.loc = target return 1 else if(IC) diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm index db3771ad215..0073c59f8d0 100644 --- a/code/modules/surgery/dental_implant.dm +++ b/code/modules/surgery/dental_implant.dm @@ -15,8 +15,7 @@ if(!istype(tool)) return 0 - user.drop_item() - tool.loc = target + user.transferItemToLoc(tool, target, TRUE) var/datum/action/item_action/hands_free/activate_pill/P = new(tool) P.button.name = "Activate [tool.name]" diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index 2357ff134aa..2efd79539ae 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -53,7 +53,6 @@ L.change_bodypart_status(BODYPART_ROBOTIC, TRUE) L.icon = tool.icon L.max_damage = tool.max_damage - user.drop_item() qdel(tool) target.update_body_parts() target.updatehealth() diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 42bfd30893f..1fa7fee496e 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -121,7 +121,7 @@ tool = I else I = tool - user.drop_item() + user.temporarilyRemoveItemFromInventory(I, TRUE) I.Insert(target) user.visible_message("[user] inserts [tool] into [target]'s [parse_zone(target_zone)]!", "You insert [tool] into [target]'s [parse_zone(target_zone)].") diff --git a/code/modules/surgery/organs/autosurgeon.dm b/code/modules/surgery/organs/autosurgeon.dm index caa6cc7a974..0de1683fbd2 100644 --- a/code/modules/surgery/organs/autosurgeon.dm +++ b/code/modules/surgery/organs/autosurgeon.dm @@ -49,9 +49,8 @@ else if(!uses) to_chat(user, "[src] has already been used up.") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return - I.forceMove(src) storedorgan = I to_chat(user, "You insert the [I] into [src].") else if(istype(I, /obj/item/screwdriver)) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index d1699cb2576..9308154c486 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -89,7 +89,7 @@ /obj/item/organ/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target) if(H == user && istype(H)) playsound(user,'sound/effects/singlebeat.ogg',40,1) - user.drop_item() + user.temporarilyRemoveItemFromInventory(src, TRUE) Insert(user) else return ..() diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 4fdda7a7bcc..681dcb21cf8 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -92,10 +92,9 @@ if(status == ORGAN_ORGANIC) var/obj/item/reagent_containers/food/snacks/S = prepare_eat() if(S) - H.drop_item() - H.put_in_active_hand(S) - S.attack(H, H) qdel(src) + if(H.put_in_active_hand(S)) + S.attack(H, H) else ..() diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index e817416d7e8..2dddb95872d 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -63,9 +63,8 @@ tool.desc = "A container for holding body parts." tool.cut_overlays() tool = tool.contents[1] - if(istype(tool, /obj/item/bodypart)) + if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool)) var/obj/item/bodypart/L = tool - user.drop_item() L.attach_limb(target) if(organ_rejection_dam) target.adjustToxLoss(organ_rejection_dam) diff --git a/code/modules/vehicles/pimpin_ride.dm b/code/modules/vehicles/pimpin_ride.dm index 7be42b6e4df..0d97cb63c19 100644 --- a/code/modules/vehicles/pimpin_ride.dm +++ b/code/modules/vehicles/pimpin_ride.dm @@ -47,10 +47,9 @@ if(mybag) to_chat(user, "[src] already has a trashbag hooked!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(I, src)) return to_chat(user, "You hook the trashbag onto [src].") - I.loc = src mybag = I update_icon() else if(istype(I, /obj/item/janiupgrade)) From b4a6785e01aa17166806e065b482523770f57356 Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 10:36:36 -0700 Subject: [PATCH 21/24] Automatic changelog generation for PR #31386 [ci skip] --- html/changelogs/AutoChangeLog-pr-31386.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31386.yml diff --git a/html/changelogs/AutoChangeLog-pr-31386.yml b/html/changelogs/AutoChangeLog-pr-31386.yml new file mode 100644 index 00000000000..e076a2a619f --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31386.yml @@ -0,0 +1,5 @@ +author: "Cyberboss" +delete-after: True +changes: + - bugfix: "Fixed a rare case where creating a one tank bomb would result in a broken object" + - bugfix: "Fixed many cases where forced item drops could be avoided by not having an item in your active hand" From 119f3fa02b09f7a58cc2fc0d10ccd1a09d020c7a Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Sat, 7 Oct 2017 10:37:27 -0700 Subject: [PATCH 22/24] Allows editing config.allow_admin_ooccolor (#31371) Because server ops can manually decide to lock a config by prepending an @ sign in front of the config entry, there is no reason to lock this out. --- code/controllers/configuration/entries/config.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm index 3be6db06c71..f4f27b14247 100644 --- a/code/controllers/configuration/entries/config.dm +++ b/code/controllers/configuration/entries/config.dm @@ -56,7 +56,6 @@ CONFIG_DEF(flag/log_twitter) // log certain expliotable parrots and other such f CONFIG_DEF(flag/log_world_topic) // log all world.Topic() calls CONFIG_DEF(flag/allow_admin_ooccolor) // Allows admins with relevant permissions to have their own ooc colour - protection = CONFIG_ENTRY_LOCKED CONFIG_DEF(flag/allow_vote_restart) // allow votes to restart @@ -350,7 +349,6 @@ CONFIG_DEF(flag/irc_announce_new_game) CONFIG_DEF(flag/debug_admin_hrefs) - CONFIG_DEF(number/mc_tick_rate/base_mc_tick_rate) integer = FALSE value = 1 @@ -371,4 +369,4 @@ CONFIG_TWEAK(number/mc_tick_rate) CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val)) . = ..() if (.) - Master.UpdateTickRate() + Master.UpdateTickRate() \ No newline at end of file From 578baf76de38b07432a163ea15b8da7214515dd3 Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 11:36:30 -0700 Subject: [PATCH 23/24] Automatic changelog generation for PR #31388 [ci skip] --- html/changelogs/AutoChangeLog-pr-31388.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31388.yml diff --git a/html/changelogs/AutoChangeLog-pr-31388.yml b/html/changelogs/AutoChangeLog-pr-31388.yml new file mode 100644 index 00000000000..b4865f12c70 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31388.yml @@ -0,0 +1,4 @@ +author: "Naksu" +delete-after: True +changes: + - bugfix: "Tweaks to atmos performance" From a15d879f48c567c5eac0c2629371df512fa2f067 Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 7 Oct 2017 11:37:59 -0700 Subject: [PATCH 24/24] Automatic changelog generation for PR #31389 [ci skip] --- html/changelogs/AutoChangeLog-pr-31389.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-31389.yml diff --git a/html/changelogs/AutoChangeLog-pr-31389.yml b/html/changelogs/AutoChangeLog-pr-31389.yml new file mode 100644 index 00000000000..491dd057e4c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-31389.yml @@ -0,0 +1,4 @@ +author: "Y0SH1_M4S73R" +delete-after: True +changes: + - balance: "Gygax overdrive consumes at least 100 power per step"