Merge pull request #38499 from AnturK/runtimeH

Fixes Pubby mapedit.
This commit is contained in:
Jordan Brown
2018-06-16 16:48:02 -04:00
committed by GitHub
2 changed files with 10 additions and 6 deletions
+9 -5
View File
@@ -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)