Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonespace27 committed Feb 25, 2024
1 parent 90d7aba commit fbb26be
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/modules/vehicles/arc/arc.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/vehicle/multitile/arc
name = "M540-A Armored Recon Carrier"
name = "\improper M540-A Armored Recon Carrier"
desc = "An M540-A Armored Recon Carrier. A lightly armored reconnaissance and intelligence vehicle. Entrances on the sides."

icon = 'icons/obj/vehicles/arc.dmi'
Expand Down
4 changes: 4 additions & 0 deletions code/modules/vehicles/hardpoints/hardpoint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -791,3 +791,7 @@

/obj/item/hardpoint/get_applying_acid_time()
return 10 SECONDS //you are not supposed to be able to easily combat-melt irreplaceable things.

/// Proc to be overridden if you want to have special conditions preventing the removal of the hardpoint. Add chat messages in this proc if you want to tell the player why
/obj/item/hardpoint/proc/can_be_removed(mob/remover)
return TRUE
14 changes: 13 additions & 1 deletion code/modules/vehicles/hardpoints/primary/arc_sentry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
/obj/item/hardpoint/primary/arc_sentry/on_install(obj/vehicle/multitile/V)
. = ..()
RegisterSignal(owner, COMSIG_ARC_ANTENNA_TOGGLED, PROC_REF(toggle_processing))
toggle_processing() // We can't know that the antenna is in the same position as when the gun was removed

/obj/item/hardpoint/primary/arc_sentry/on_uninstall(obj/vehicle/multitile/V)
. = ..()
UnregisterSignal(owner, COMSIG_ARC_ANTENNA_TOGGLED)
START_PROCESSING(SSfastobj, src)
STOP_PROCESSING(SSfastobj, src)

/obj/item/hardpoint/primary/arc_sentry/Destroy()
STOP_PROCESSING(SSfastobj, src)
Expand Down Expand Up @@ -278,6 +279,17 @@

start_fire(object = sentry_target)

/obj/item/hardpoint/primary/arc_sentry/can_be_removed(mob/remover)
var/obj/vehicle/multitile/arc/arc_owner = owner
if(!istype(arc_owner))
return TRUE

if(arc_owner.antenna_deployed)
to_chat(remover, SPAN_WARNING("[src] cannot be removed from [owner] while its antenna is deployed."))
return FALSE

return TRUE

/obj/projectile/arc_sentry/Initialize(mapload, datum/cause_data/cause_data)
. = ..()
RegisterSignal(src, COMSIG_BULLET_POST_HANDLE_OBJ, PROC_REF(check_passthrough))
Expand Down
11 changes: 11 additions & 0 deletions code/modules/vehicles/hardpoints/support/antenna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,14 @@
else
I.color = null
return I

/obj/item/hardpoint/support/arc_antenna/can_be_removed(mob/remover)
var/obj/vehicle/multitile/arc/arc_owner = owner
if(!istype(arc_owner))
return TRUE

if(arc_owner.antenna_deployed)
to_chat(remover, SPAN_WARNING("[src] cannot be removed from [owner] while its antenna is deployed."))
return FALSE

return TRUE
3 changes: 3 additions & 0 deletions code/modules/vehicles/multitile/multitile_hardpoints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
to_chat(user, SPAN_WARNING("There is nothing installed there."))
return

if(!old.can_be_removed(user))
return

// It's in a holder
if(!(old in hardpoints))
for(var/obj/item/hardpoint/holder/H in hardpoints)
Expand Down

0 comments on commit fbb26be

Please sign in to comment.