From 180c87f8e0da2ae83bed8c0df98d0513fc48778c Mon Sep 17 00:00:00 2001 From: AnturK Date: Thu, 25 Apr 2019 18:09:34 +0200 Subject: [PATCH] Fixes transforming weapons resetting their throw speed. (#43684) * Fixes transforming weapons resetting their throw speed. * mhm * Let's make this simple. --- code/datums/explosion.dm | 1 - code/game/objects/items.dm | 1 - code/modules/mob/living/carbon/human/human_defense.dm | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index 4c2659e37a2..27c483bc12a 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -221,7 +221,6 @@ GLOBAL_LIST_EMPTY(explosions) if(!I.anchored) var/throw_range = rand(throw_dist, max_range) var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range) - I.throw_speed = EXPLOSION_THROW_SPEED //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything) I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED) //wait for the lists to repop diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 16caeb0d151..faeb433c814 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -534,7 +534,6 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) /obj/item/proc/after_throw(datum/callback/callback) if (callback) //call the original callback . = callback.Invoke() - throw_speed = initial(throw_speed) //explosions change this. item_flags &= ~IN_INVENTORY /obj/item/proc/remove_item_from_storage(atom/newLoc) //please use this if you're going to snowflake an item out of a obj/item/storage diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 1998b137f53..0dacc4ca3e2 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -153,7 +153,7 @@ skipcatch = TRUE blocked = TRUE else if(I) - if((I.throw_speed >= EMBED_THROWSPEED_THRESHOLD) || I.embedding.embedded_ignore_throwspeed_threshold) + if(((throwingdatum ? throwingdatum.speed : I.throw_speed) >= EMBED_THROWSPEED_THRESHOLD) || I.embedding.embedded_ignore_throwspeed_threshold) if(can_embed(I)) if(prob(I.embedding.embed_chance) && !has_trait(TRAIT_PIERCEIMMUNE)) throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)