Skip to content

Commit

Permalink
Fixes bombs breaking (#22349)
Browse files Browse the repository at this point in the history
* REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

* FAIR FUCKING WARNING

* OOP

* Prolly better off here

* Less superfluous warning

* More passive aggressive

* "Strike that! Reverse it."

* DRY destruction
  • Loading branch information
Cyberboss authored and optimumtact committed Dec 22, 2016
1 parent 666f28a commit b1e4a9a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions code/game/machinery/syndicatebomb.dm
Expand Up @@ -30,6 +30,19 @@
var/detonation_timer
var/explode_now = FALSE

/obj/machinery/syndicatebomb/proc/try_detonate()
. = (payload in src) && active && !defused
if(.)
payload.detonate()

/obj/machinery/syndicatebomb/obj_break()
if(!try_detonate())
..()

/obj/machinery/syndicatebomb/obj_destruction()
if(!try_detonate())
..()

/obj/machinery/syndicatebomb/process()
if(!active)
STOP_PROCESSING(SSfastprocess, src)
Expand Down Expand Up @@ -60,8 +73,7 @@
active = FALSE
timer_set = initial(timer_set)
update_icon()
if(payload in src)
payload.detonate()
try_detonate()
//Counter terrorists win
else if(!active || defused)
if(defused && payload in src)
Expand Down Expand Up @@ -166,7 +178,10 @@
new /obj/item/stack/sheet/plasteel( loc, 5)
qdel(src)
else
var/old_integ = obj_integrity
. = ..()
if((old_integ > obj_integrity) && active && !defused && (payload in src))
user << "<span class='warning'>That seems like a really bad idea...</span>"

/obj/machinery/syndicatebomb/attack_hand(mob/user)
interact(user)
Expand Down

0 comments on commit b1e4a9a

Please sign in to comment.