Skip to content

Commit

Permalink
Misc. code styling
Browse files Browse the repository at this point in the history
Variable names, 1 to TRUE, and I also removed the bool returns since nothing's actually checking for them.
  • Loading branch information
SabreML committed Feb 6, 2024
1 parent b8e4495 commit 2b69324
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions code/modules/dropships/attach_points/attach_point.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,45 @@

/obj/effect/attach_point/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/powerloader_clamp))
var/obj/item/powerloader_clamp/PC = I
install_equipment(PC, user)
var/obj/item/powerloader_clamp/clamp = I
install_equipment(clamp, user)
return TRUE
return ..()

/// Called when a real user with a powerloader attempts to install an equipment on the attach point
/obj/effect/attach_point/proc/install_equipment(obj/item/powerloader_clamp/PC, mob/living/user)
if(!istype(PC.loaded, /obj/structure/dropship_equipment))
/obj/effect/attach_point/proc/install_equipment(obj/item/powerloader_clamp/clamp, mob/living/user)
if(!istype(clamp.loaded, /obj/structure/dropship_equipment))
return
var/obj/structure/dropship_equipment/ds_equipment = clamp.loaded
if(!(base_category in ds_equipment.equip_categories))
to_chat(user, SPAN_WARNING("[ds_equipment] doesn't fit on [src]."))
return
var/obj/structure/dropship_equipment/SE = PC.loaded
if(!(base_category in SE.equip_categories))
to_chat(user, SPAN_WARNING("[SE] doesn't fit on [src]."))
return TRUE
if(installed_equipment)
return TRUE
playsound(loc, 'sound/machines/hydraulics_1.ogg', 40, 1)
return
playsound(loc, 'sound/machines/hydraulics_1.ogg', 40, TRUE)
var/point_loc = loc
if(!user || !do_after(user, (7 SECONDS) * user.get_skill_duration_multiplier(SKILL_ENGINEER), INTERRUPT_NO_NEEDHAND|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return TRUE
return
if(loc != point_loc)//dropship flew away
return TRUE
if(installed_equipment || PC.loaded != SE)
return TRUE
to_chat(user, SPAN_NOTICE("You install [SE] on [src]."))
SE.forceMove(loc)
PC.loaded = null
playsound(loc, 'sound/machines/hydraulics_2.ogg', 40, 1)
PC.update_icon()
installed_equipment = SE
SE.ship_base = src
SE.plane = plane
return
if(installed_equipment || clamp.loaded != ds_equipment)
return
to_chat(user, SPAN_NOTICE("You install [ds_equipment] on [src]."))
ds_equipment.forceMove(loc)
clamp.loaded = null
playsound(loc, 'sound/machines/hydraulics_2.ogg', 40, TRUE)
clamp.update_icon()
installed_equipment = ds_equipment
ds_equipment.ship_base = src
ds_equipment.plane = plane

for(var/obj/docking_port/mobile/marine_dropship/shuttle in SSshuttle.mobile)
if(shuttle.id == ship_tag)
SE.linked_shuttle = shuttle
SEND_SIGNAL(shuttle, COMSIG_DROPSHIP_ADD_EQUIPMENT, SE)
ds_equipment.linked_shuttle = shuttle
SEND_SIGNAL(shuttle, COMSIG_DROPSHIP_ADD_EQUIPMENT, ds_equipment)
break

SE.update_equipment()
ds_equipment.update_equipment()

/// Weapon specific attachment point
/obj/effect/attach_point/weapon
Expand Down

0 comments on commit 2b69324

Please sign in to comment.