diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index cf3a18d5ce0..182854f9d03 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -31877,7 +31877,7 @@ /obj/machinery/atmospherics/components/unary/vent_pump/on, /obj/effect/landmark/blobstart, /obj/item/melee/baton/cattleprod{ - cell = new /obj/item/stock_parts/cell/high() + preload_cell_type = /obj/item/stock_parts/cell/high }, /turf/open/floor/plasteel/dark, /area/medical/exam_room) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index e457ac5c122..d6859d1dba3 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -14,9 +14,10 @@ var/stunforce = 140 var/status = 0 - var/obj/item/stock_parts/cell/high/cell + var/obj/item/stock_parts/cell/cell var/hitcost = 1000 var/throw_hit_chance = 35 + var/preload_cell_type //if not empty the baton starts with this type of cell /obj/item/melee/baton/get_cell() return cell @@ -27,6 +28,11 @@ /obj/item/melee/baton/Initialize() . = ..() + if(preload_cell_type) + if(!ispath(preload_cell_type,/obj/item/stock_parts/cell)) + log_world("### MAP WARNING, [src] at [AREACOORD(src)] had an invalid preload_cell_type: [preload_cell_type].") + else + cell = new preload_cell_type(src) update_icon() /obj/item/melee/baton/throw_impact(atom/hit_atom) @@ -35,10 +41,8 @@ if(status && prob(throw_hit_chance) && iscarbon(hit_atom)) baton_stun(hit_atom) -/obj/item/melee/baton/loaded/Initialize() //this one starts with a cell pre-installed. - cell = new(src) - update_icon() - . = ..() +/obj/item/melee/baton/loaded //this one starts with a cell pre-installed. + preload_cell_type = /obj/item/stock_parts/cell/high /obj/item/melee/baton/proc/deductcharge(chrgdeductamt) if(cell)