Skip to content

Commit

Permalink
Remove uneccesary var copy paste from vehicles (tgstation#70167)
Browse files Browse the repository at this point in the history
Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
TiviPlus and TiviPlus authored Sep 28, 2022
1 parent 241c1d1 commit 6e5cb2e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26 deletions.
6 changes: 1 addition & 5 deletions code/modules/vehicles/atv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -74,15 +72,14 @@
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)
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
Expand All @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions code/modules/vehicles/bicycle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -29,15 +27,14 @@
. = 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)
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
Expand All @@ -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()
Expand Down
6 changes: 1 addition & 5 deletions code/modules/vehicles/cars/vim.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -55,15 +53,14 @@
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)
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
Expand All @@ -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)
. = ..()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/vehicles/mecha/_mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions code/modules/vehicles/mecha/mecha_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions code/modules/vehicles/secway.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,15 +32,14 @@
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)
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
Expand All @@ -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))
Expand Down

0 comments on commit 6e5cb2e

Please sign in to comment.