From de331bbe6016e747353be249d61b1354fc6363eb Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 28 Sep 2022 22:17:48 +0200 Subject: [PATCH] [MIRROR] Remove uneccesary var copy paste from vehicles [MDB IGNORE] (#16513) * Remove uneccesary var copy paste from vehicles (#70167) Co-authored-by: TiviPlus <572233640+TiviPlus@ users.noreply.com> * Remove uneccesary var copy paste from vehicles Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> Co-authored-by: TiviPlus <572233640+TiviPlus@ users.noreply.com> --- code/modules/vehicles/atv.dm | 6 +----- code/modules/vehicles/bicycle.dm | 6 +----- code/modules/vehicles/cars/vim.dm | 6 +----- code/modules/vehicles/mecha/_mecha.dm | 2 -- code/modules/vehicles/mecha/mecha_defense.dm | 6 ++---- code/modules/vehicles/secway.dm | 6 +----- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/code/modules/vehicles/atv.dm b/code/modules/vehicles/atv.dm index 1da429d4845..29f49d35c84 100644 --- a/code/modules/vehicles/atv.dm +++ b/code/modules/vehicles/atv.dm @@ -7,8 +7,6 @@ armor = list(MELEE = 50, BULLET = 25, LASER = 20, ENERGY = 0, BOMB = 50, BIO = 0, FIRE = 60, ACID = 60) key_type = /obj/item/key/atv integrity_failure = 0.5 - ///What mobs are currently repairing us. - var/list/mob/living/repairing_mobs var/static/mutable_appearance/atvcover /obj/vehicle/ridden/atv/Initialize(mapload) @@ -74,7 +72,7 @@ if(user.combat_mode) return . = TRUE - if(LAZYFIND(repairing_mobs, user)) + if(DOING_INTERACTION(user, src)) balloon_alert(user, "you're already repairing it!") return if(atom_integrity >= max_integrity) @@ -82,7 +80,6 @@ return if(!W.tool_start_check(user, amount=1)) return - LAZYADD(repairing_mobs, user) user.balloon_alert_to_viewers("started welding [src]", "started repairing [src]") audible_message(span_hear("You hear welding.")) var/did_the_thing @@ -97,7 +94,6 @@ user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]") else user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!") - LAZYREMOVE(repairing_mobs, user) /obj/vehicle/ridden/atv/atom_break() START_PROCESSING(SSobj, src) diff --git a/code/modules/vehicles/bicycle.dm b/code/modules/vehicles/bicycle.dm index 5e636b4681f..281877115ac 100644 --- a/code/modules/vehicles/bicycle.dm +++ b/code/modules/vehicles/bicycle.dm @@ -5,8 +5,6 @@ max_integrity = 150 integrity_failure = 0.5 var/fried = FALSE - ///What mobs are currently repairing us. - var/list/mob/living/repairing_mobs /obj/vehicle/ridden/bicycle/Initialize(mapload) . = ..() @@ -29,7 +27,7 @@ . = TRUE if(fried) balloon_alert(user, "it's fried!") - if(LAZYFIND(repairing_mobs, user)) + if(DOING_INTERACTION(user, src)) balloon_alert(user, "you're already repairing it!") return if(atom_integrity >= max_integrity) @@ -37,7 +35,6 @@ return if(!W.tool_start_check(user, amount=1)) return - LAZYADD(repairing_mobs, user) user.balloon_alert_to_viewers("started welding [src]", "started repairing [src]") audible_message(span_hear("You hear welding.")) var/did_the_thing @@ -52,7 +49,6 @@ user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]") else user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!") - LAZYREMOVE(repairing_mobs, user) ///can we still fix the bike lol /obj/vehicle/ridden/bicycle/proc/can_still_fix() diff --git a/code/modules/vehicles/cars/vim.dm b/code/modules/vehicles/cars/vim.dm index bf8d60c5695..466cc0b2b09 100644 --- a/code/modules/vehicles/cars/vim.dm +++ b/code/modules/vehicles/cars/vim.dm @@ -18,8 +18,6 @@ light_power = 2 light_on = FALSE engine_sound = 'sound/effects/servostep.ogg' - ///What mobs are currently repairing us. - var/list/mob/living/repairing_mobs ///Maximum size of a mob trying to enter the mech var/maximum_mob_size = MOB_SIZE_SMALL COOLDOWN_DECLARE(sound_cooldown) @@ -55,7 +53,7 @@ if(user.combat_mode) return . = TRUE - if(LAZYFIND(repairing_mobs, user)) + if(DOING_INTERACTION(user, src)) balloon_alert(user, "you're already repairing it!") return if(atom_integrity >= max_integrity) @@ -63,7 +61,6 @@ return if(!W.tool_start_check(user, amount=1)) return - LAZYADD(repairing_mobs, user) user.balloon_alert_to_viewers("started welding [src]", "started repairing [src]") audible_message(span_hear("You hear welding.")) var/did_the_thing @@ -78,7 +75,6 @@ user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]") else user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!") - LAZYREMOVE(repairing_mobs, user) /obj/vehicle/sealed/car/vim/mob_enter(mob/newoccupant, silent = FALSE) . = ..() diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 3ad5c120e46..e85b5205591 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -71,8 +71,6 @@ var/allow_diagonal_movement = FALSE ///Whether or not the mech destroys walls by running into it. var/bumpsmash = FALSE - ///What mobs are currently repairing us. - var/list/mob/living/repairing_mobs ///////////ATMOS ///Whether we are currrently drawing from the internal tank diff --git a/code/modules/vehicles/mecha/mecha_defense.dm b/code/modules/vehicles/mecha/mecha_defense.dm index f4ab81b97d0..072f47fb9e3 100644 --- a/code/modules/vehicles/mecha/mecha_defense.dm +++ b/code/modules/vehicles/mecha/mecha_defense.dm @@ -318,15 +318,14 @@ if(user.combat_mode) return . = TRUE - if(LAZYFIND(repairing_mobs, user)) - balloon_alert(user, "you're already repairing it!") + if(DOING_INTERACTION(user, src)) + balloon_alert(user, "you're already repairing this!") return if(atom_integrity >= max_integrity) balloon_alert(user, "it's not damaged!") return if(!W.tool_start_check(user, amount=1)) return - LAZYADD(repairing_mobs, user) user.balloon_alert_to_viewers("started welding [src]", "started repairing [src]") audible_message(span_hear("You hear welding.")) var/did_the_thing @@ -341,7 +340,6 @@ user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]") else user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!") - LAZYREMOVE(repairing_mobs, user) /obj/vehicle/sealed/mecha/proc/full_repair(charge_cell) diff --git a/code/modules/vehicles/secway.dm b/code/modules/vehicles/secway.dm index aa9480c43ae..0440925f77f 100644 --- a/code/modules/vehicles/secway.dm +++ b/code/modules/vehicles/secway.dm @@ -7,8 +7,6 @@ armor = list(MELEE = 10, BULLET = 0, LASER = 10, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 60, ACID = 60) key_type = /obj/item/key/security integrity_failure = 0.5 - ///What mobs are currently repairing us. - var/list/mob/living/repairing_mobs ///This stores a banana that, when used on the secway, prevents the vehicle from moving until it is removed. var/obj/item/food/grown/banana/eddie_murphy @@ -34,7 +32,7 @@ if(user.combat_mode) return . = TRUE - if(LAZYFIND(repairing_mobs, user)) + if(DOING_INTERACTION(user, src)) balloon_alert(user, "you're already repairing it!") return if(atom_integrity >= max_integrity) @@ -42,7 +40,6 @@ return if(!W.tool_start_check(user, amount=1)) return - LAZYADD(repairing_mobs, user) user.balloon_alert_to_viewers("started welding [src]", "started repairing [src]") audible_message(span_hear("You hear welding.")) var/did_the_thing @@ -57,7 +54,6 @@ user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]") else user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!") - LAZYREMOVE(repairing_mobs, user) /obj/vehicle/ridden/secway/attackby(obj/item/W, mob/living/user, params) if(!istype(W, /obj/item/food/grown/banana))