Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BeagleGaming1 committed Oct 8, 2023
1 parent f096d44 commit 31430ab
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions code/game/objects/prop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@

/obj/item/prop/geiger_counter/Initialize(mapload, ...)
. = ..()
if(!battery)
if(!starting_battery)
return
battery = new(starting_battery)
if(toggled_on)
icon_state = enabled_state
battery = new starting_battery(src)

/obj/item/prop/geiger_counter/Destroy()
. = ..()
Expand All @@ -49,10 +47,7 @@
to_chat(user, SPAN_NOTICE("[src] is missing a battery."))
return
to_chat(user, SPAN_NOTICE("You [toggled_on ? "enable" : "disable"] [src]."))
if(toggled_on)
icon_state = enabled_state
return
icon_state = disabled_state
update_icon()

/obj/item/prop/geiger_counter/attackby(obj/item/attacking_item, mob/user)
. = ..()
Expand All @@ -63,6 +58,15 @@
to_chat(user, SPAN_NOTICE("You jam [battery] out of [src] with [attacking_item], prying it out irreversibly."))
user.put_in_hands(battery)
battery = null
update_icon()

/obj/item/prop/geiger_counter/update_icon()
. = ..()

if(battery && toggled_on)
icon_state = enabled_state
return
icon_state = disabled_state

/obj/item/prop/tableflag
name = "United Americas table flag"
Expand Down

0 comments on commit 31430ab

Please sign in to comment.