From 0acc3b95a478016dbece4ee97ad7791add3e78fd Mon Sep 17 00:00:00 2001 From: Kyep Date: Fri, 7 Dec 2018 01:34:50 -0800 Subject: [PATCH] fixes runtime in ed209.dm access_card check, removes spawn() --- .../mob/living/simple_animal/bot/ed209bot.dm | 40 ++++++++++--------- .../mob/living/simple_animal/bot/syndicate.dm | 5 ++- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 5969d7a6d40..b5226d24ac8 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -23,12 +23,13 @@ path_image_color = "#FF0000" data_hud_type = DATA_HUD_SECURITY_ADVANCED + allow_pai = 0 + var/lastfired = 0 var/shot_delay = 3 //.3 seconds between shots var/lasercolor = "" var/disabled = 0//A holder for if it needs to be disabled, if true it will not seach for targets, shoot at targets, or move, currently only used for lasertag - var/mob/living/carbon/target var/oldtarget_name var/threatlevel = 0 @@ -41,10 +42,9 @@ var/arrest_type = 0 //If true, don't handcuff var/projectile = /obj/item/projectile/energy/electrode //Holder for projectile type var/shoot_sound = 'sound/weapons/Taser.ogg' - allow_pai = 0 -/mob/living/simple_animal/bot/ed209/New(loc,created_name,created_lasercolor) +/mob/living/simple_animal/bot/ed209/New(loc, created_name, created_lasercolor) ..() if(created_name) name = created_name @@ -52,29 +52,33 @@ lasercolor = created_lasercolor icon_state = "[lasercolor]ed209[on]" set_weapon() //giving it the right projectile and firing sound. - spawn(3) - var/datum/job/detective/J = new/datum/job/detective - access_card.access += J.get_access() - prev_access = access_card.access + setup_access() - if(lasercolor) - shot_delay = 6//Longer shot delay because JESUS CHRIST - check_records = 0//Don't actively target people set to arrest - arrest_type = 1//Don't even try to cuff - declare_arrests = 0 // Don't spam sec - bot_core.req_access = list(access_maint_tunnels, access_theatre, access_robotics) + if(lasercolor) + shot_delay = 6//Longer shot delay because JESUS CHRIST + check_records = 0//Don't actively target people set to arrest + arrest_type = 1//Don't even try to cuff + declare_arrests = 0 // Don't spam sec + bot_core.req_access = list(access_maint_tunnels, access_theatre, access_robotics) - if(created_name == initial(name) || !created_name) - if(lasercolor == "b") - name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT") - else if (lasercolor == "r") - name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") + if(created_name == initial(name) || !created_name) + if(lasercolor == "b") + name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT") + else if (lasercolor == "r") + name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") //SECHUD var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED] secsensor.add_hud_to(src) permanent_huds |= secsensor + +/mob/living/simple_animal/bot/ed209/proc/setup_access() + if(access_card) + var/datum/job/detective/J = new/datum/job/detective + access_card.access += J.get_access() + prev_access = access_card.access + /mob/living/simple_animal/bot/ed209/turn_on() . = ..() icon_state = "[lasercolor]ed209[on]" diff --git a/code/modules/mob/living/simple_animal/bot/syndicate.dm b/code/modules/mob/living/simple_animal/bot/syndicate.dm index f9022d775c5..f2c43420cfa 100644 --- a/code/modules/mob/living/simple_animal/bot/syndicate.dm +++ b/code/modules/mob/living/simple_animal/bot/syndicate.dm @@ -29,12 +29,13 @@ /mob/living/simple_animal/bot/ed209/syndicate/New() ..() - if(access_card) - access_card.access = list(access_syndicate, access_syndicate_leader) set_weapon() update_icon() spawn_turf = get_turf(src) +/mob/living/simple_animal/bot/ed209/syndicate/setup_access() + if(access_card) + access_card.access = list(access_syndicate, access_syndicate_leader) /mob/living/simple_animal/bot/ed209/syndicate/update_icon() icon_state = initial(icon_state)