diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 7d1b8ee6ebc..f9b9850bd2d 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -690,6 +690,8 @@ proc/dd_sortedObjectList(list/incoming) // LAZYING PT 2: THE LAZENING #define LAZYREINITLIST(L) LAZYCLEARLIST(L); LAZYINITLIST(L); +// Lazying Episode 3 +#define LAZYSET(L, K, V) LAZYINITLIST(L); L[K] = V; //same, but returns nothing and acts on list in place /proc/shuffle_inplace(list/L) diff --git a/code/_globalvars/mapping.dm b/code/_globalvars/mapping.dm index ca1c899e301..d67875db2de 100644 --- a/code/_globalvars/mapping.dm +++ b/code/_globalvars/mapping.dm @@ -3,8 +3,9 @@ #define Z_SOUTH 3 #define Z_WEST 4 -GLOBAL_LIST_INIT(cardinal, list( NORTH, SOUTH, EAST, WEST )) +GLOBAL_LIST_INIT(cardinal, list(NORTH, SOUTH, EAST, WEST)) GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(alldirs2, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTH, SOUTH, EAST, WEST)) GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) // This must exist early on or shit breaks bad diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index d49c0ee59eb..a93e65c762b 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -19,9 +19,8 @@ if(!category) return - var/obj/screen/alert/alert - if(alerts[category]) - alert = alerts[category] + var/obj/screen/alert/alert = LAZYACCESS(alerts, category) + if(alert) if(alert.override_alerts) return 0 if(new_master && new_master != alert.master) @@ -57,7 +56,7 @@ alert.icon_state = "[initial(alert.icon_state)][severity]" alert.severity = severity - alerts[category] = alert + LAZYSET(alerts, category, alert) // This also creates the list if it doesn't exist if(client && hud_used) hud_used.reorganize_alerts() alert.transform = matrix(32, 6, MATRIX_TRANSLATE) @@ -72,7 +71,7 @@ // Proc to clear an existing alert. /mob/proc/clear_alert(category, clear_override = FALSE) - var/obj/screen/alert/alert = alerts[category] + var/obj/screen/alert/alert = LAZYACCESS(alerts, category) if(!alert) return 0 if(alert.override_alerts && !clear_override) @@ -585,12 +584,14 @@ so as to remain in compliance with the most up-to-date laws." // Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there /datum/hud/proc/reorganize_alerts() var/list/alerts = mymob.alerts + if(!alerts) + return FALSE var/icon_pref if(!hud_shown) - for(var/i = 1, i <= alerts.len, i++) + for(var/i in 1 to alerts.len) mymob.client.screen -= alerts[alerts[i]] - return 1 - for(var/i = 1, i <= alerts.len, i++) + return TRUE + for(var/i in 1 to alerts.len) var/obj/screen/alert/alert = alerts[alerts[i]] if(alert.icon_state == "template") if(!icon_pref) @@ -611,10 +612,10 @@ so as to remain in compliance with the most up-to-date laws." . = "" alert.screen_loc = . mymob.client.screen |= alert - return 1 + return TRUE /mob - var/list/alerts = list() // contains /obj/screen/alert only // On /mob so clientless mobs will throw alerts properly + var/list/alerts // lazy list. contains /obj/screen/alert only // On /mob so clientless mobs will throw alerts properly /obj/screen/alert/Click(location, control, params) if(!usr || !usr.client) diff --git a/code/datums/armor.dm b/code/datums/armor.dm new file mode 100644 index 00000000000..01a796b6cc0 --- /dev/null +++ b/code/datums/armor.dm @@ -0,0 +1,66 @@ +#define ARMORID "armor-[melee]-[bullet]-[laser]-[energy]-[bomb]-[bio]-[rad]-[fire]-[acid]" + +/proc/getArmor(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) + . = locate(ARMORID) + if (!.) + . = new /datum/armor(melee, bullet, laser, energy, bomb, bio, rad, fire, acid) + +/datum/armor + var/melee + var/bullet + var/laser + var/energy + var/bomb + var/bio + var/rad + var/fire + var/acid + +/datum/armor/New(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) + src.melee = melee + src.bullet = bullet + src.laser = laser + src.energy = energy + src.bomb = bomb + src.bio = bio + src.rad = rad + src.fire = fire + src.acid = acid + tag = ARMORID + +/datum/armor/proc/modifyRating(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) + return getArmor(src.melee + melee, src.bullet + bullet, src.laser + laser, src.energy + energy, src.bomb + bomb, src.bio + bio, src.rad + rad, src.fire + fire, src.acid + acid) + +/datum/armor/proc/modifyAllRatings(modifier = 0) + return getArmor(melee + modifier, bullet + modifier, laser + modifier, energy + modifier, bomb + modifier, bio + modifier, rad + modifier, fire + modifier, acid + modifier) + +/datum/armor/proc/setRating(melee, bullet, laser, energy, bomb, bio, rad, fire, acid) + return getArmor((isnull(melee) ? src.melee : melee),\ + (isnull(bullet) ? src.bullet : bullet),\ + (isnull(laser) ? src.laser : laser),\ + (isnull(energy) ? src.energy : energy),\ + (isnull(bomb) ? src.bomb : bomb),\ + (isnull(bio) ? src.bio : bio),\ + (isnull(rad) ? src.rad : rad),\ + (isnull(fire) ? src.fire : fire),\ + (isnull(acid) ? src.acid : acid)) + +/datum/armor/proc/getRating(rating) + return vars[rating] + +/datum/armor/proc/getList() + return list("melee" = melee, "bullet" = bullet, "laser" = laser, "energy" = energy, "bomb" = bomb, "bio" = bio, "rad" = rad, "fire" = fire, "acid" = acid) + +/datum/armor/proc/attachArmor(datum/armor/AA) + return getArmor(melee + AA.melee, bullet + AA.bullet, laser + AA.laser, energy + AA.energy, bomb + AA.bomb, bio + AA.bio, rad + AA.rad, fire + AA.fire, acid + AA.acid) + +/datum/armor/proc/detachArmor(datum/armor/AA) + return getArmor(melee - AA.melee, bullet - AA.bullet, laser - AA.laser, energy - AA.energy, bomb - AA.bomb, bio - AA.bio, rad - AA.rad, fire - AA.fire, acid - AA.acid) + +/datum/armor/vv_edit_var(var_name, var_value) + if (var_name == NAMEOF(src, tag)) + return FALSE + . = ..() + tag = ARMORID // update tag in case armor values were edited + +#undef ARMORID diff --git a/code/game/atoms.dm b/code/game/atoms.dm index abd224e409b..0b51322ad15 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -14,21 +14,17 @@ var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom. var/simulated = TRUE //filter for actions - used by lighting overlays var/atom_say_verb = "says" - var/dont_save = 0 // For atoms that are temporary by necessity - like lighting overlays - + var/dont_save = FALSE // For atoms that are temporary by necessity - like lighting overlays ///Chemistry. var/container_type = NONE var/datum/reagents/reagents = null //This atom's HUD (med/sec, etc) images. Associative list. - var/list/image/hud_list = list() + var/list/image/hud_list //HUD images that this atom can provide. var/list/hud_possible - ///Chemistry. - - //Value used to increment ex_act() if reactionary_explosions is on var/explosion_block = 0 @@ -38,9 +34,9 @@ //Detective Work, used for allowing a given atom to leave its fibers on stuff. Allowed by default var/can_leave_fibers = TRUE - var/allow_spin = 1 //Set this to 1 for a _target_ that is being thrown at; if an atom has this set to 1 then atoms thrown AT it will not spin; currently used for the singularity. -Fox + var/allow_spin = TRUE //Set this to 1 for a _target_ that is being thrown at; if an atom has this set to 1 then atoms thrown AT it will not spin; currently used for the singularity. -Fox - var/admin_spawned = 0 //was this spawned by an admin? used for stat tracking stuff. + var/admin_spawned = FALSE //was this spawned by an admin? used for stat tracking stuff. var/initialized = FALSE @@ -67,7 +63,6 @@ // we were deleted return - //Called after New if the map is being loaded. mapload = TRUE //Called from base of New if the map is not being loaded. mapload = FALSE //This base must be called or derivatives must set initialized to TRUE @@ -101,7 +96,6 @@ return INITIALIZE_HINT_NORMAL - //called if Initialize returns INITIALIZE_HINT_LATELOAD /atom/proc/LateInitialize() return @@ -114,34 +108,34 @@ return /atom/proc/onCentcom() + . = FALSE var/turf/T = get_turf(src) if(!T) - return 0 + return if(!is_admin_level(T.z))//if not, don't bother - return 0 + return //check for centcomm shuttles for(var/centcom_shuttle in list("emergency", "pod1", "pod2", "pod3", "pod4", "ferry")) var/obj/docking_port/mobile/M = SSshuttle.getShuttle(centcom_shuttle) if(T in M.areaInstance) - return 1 + return TRUE //finally check for centcom itself - return istype(T.loc,/area/centcom) + return istype(T.loc, /area/centcom) /atom/proc/onSyndieBase() + . = FALSE var/turf/T = get_turf(src) if(!T) - return 0 + return if(!is_admin_level(T.z))//if not, don't bother - return 0 + return if(istype(T.loc, /area/shuttle/syndicate_elite) || istype(T.loc, /area/syndicate_mothership)) - return 1 - - return 0 + return TRUE /atom/Destroy() if(alternate_appearances) @@ -202,7 +196,7 @@ else return null -/atom/proc/check_eye(user) +/atom/proc/check_eye(mob/user) return /atom/proc/on_reagent_change() @@ -217,11 +211,11 @@ /// Is this atom injectable into other atoms /atom/proc/is_injectable(mob/user, allowmobs = TRUE) - return reagents && (container_type & (INJECTABLE | REFILLABLE)) + return reagents && (container_type & (INJECTABLE|REFILLABLE)) /// Can we draw from this atom with an injectable atom /atom/proc/is_drawable(mob/user, allowmobs = TRUE) - return reagents && (container_type & (DRAWABLE | DRAINABLE)) + return reagents && (container_type & (DRAWABLE|DRAINABLE)) /// Can this atoms reagents be refilled /atom/proc/is_refillable() @@ -232,28 +226,28 @@ return reagents && (container_type & DRAINABLE) /atom/proc/CheckExit() - return 1 + return TRUE /atom/proc/HasProximity(atom/movable/AM as mob|obj) return -/atom/proc/emp_act(var/severity) +/atom/proc/emp_act(severity = 0) return -/atom/proc/bullet_act(obj/item/projectile/P, def_zone) +/atom/proc/bullet_act(obj/item/projectile/P, def_zone = "") SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone) . = P.on_hit(src, 0, def_zone) /atom/proc/in_contents_of(container)//can take class or object instance as argument if(ispath(container)) if(istype(src.loc, container)) - return 1 + return TRUE else if(src in container) - return 1 - return + return TRUE + return FALSE /* - * atom/proc/search_contents_for(path,list/filter_path=null) + * atom/proc/search_contents_for(path, list/filter_path = null) * Recursevly searches all atom contens (including contents contents and so on). * * ARGS: path - search atom contents for atoms of this type @@ -262,7 +256,7 @@ * RETURNS: list of found atoms */ -/atom/proc/search_contents_for(path,list/filter_path=null) +/atom/proc/search_contents_for(path, list/filter_path = null) var/list/found = list() for(var/atom/A in src) if(istype(A, path)) @@ -274,7 +268,7 @@ if(!pass) continue if(A.contents.len) - found += A.search_contents_for(path,filter_path) + found += A.search_contents_for(path, filter_path) return found @@ -325,7 +319,7 @@ /atom/proc/blob_act(obj/structure/blob/B) SEND_SIGNAL(src, COMSIG_ATOM_BLOB_ACT, B) -/atom/proc/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE) +/atom/proc/fire_act(datum/gas_mixture/air, exposed_temperature = 0, exposed_volume = 0, global_overlay = TRUE) SEND_SIGNAL(src, COMSIG_ATOM_FIRE_ACT, exposed_temperature, exposed_volume) if(reagents) reagents.temperature_reagents(exposed_temperature) @@ -384,7 +378,7 @@ // Atoms that return TRUE prevent RPDs placing any kind of pipes on their turf. return FALSE -/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +/atom/proc/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = FALSE, blocked = FALSE, datum/thrownthing/throwingdatum) if(density && !has_gravity(AM)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). addtimer(CALLBACK(src, .proc/hitby_react, AM), 2) @@ -406,43 +400,47 @@ /atom/proc/after_slip(mob/living/carbon/human/H) return -/atom/proc/add_hiddenprint(mob/living/M as mob) - if(isnull(M)) return - if(isnull(M.key)) return +/atom/proc/add_hiddenprint(mob/living/M) + if(isnull(M)) + return + if(isnull(M.key)) + return if(ishuman(M)) var/mob/living/carbon/human/H = M if(!istype(H.dna, /datum/dna)) - return 0 + return FALSE if(H.gloves) if(fingerprintslast != H.ckey) //Add the list if it does not exist. if(!fingerprintshidden) fingerprintshidden = list() - fingerprintshidden += text("\[[time_stamp()]\] (Wearing gloves). Real name: [], Key: []",H.real_name, H.key) + fingerprintshidden += text("\[[time_stamp()]\] (Wearing gloves). Real name: [], Key: []", H.real_name, H.key) fingerprintslast = H.ckey - return 0 + return FALSE if(!fingerprints) if(fingerprintslast != H.ckey) //Add the list if it does not exist. if(!fingerprintshidden) fingerprintshidden = list() - fingerprintshidden += text("\[[time_stamp()]\] Real name: [], Key: []",H.real_name, H.key) + fingerprintshidden += text("\[[time_stamp()]\] Real name: [], Key: []", H.real_name, H.key) fingerprintslast = H.ckey - return 1 + return TRUE else if(fingerprintslast != M.ckey) //Add the list if it does not exist. if(!fingerprintshidden) fingerprintshidden = list() - fingerprintshidden += text("\[[time_stamp()]\] Real name: [], Key: []",M.real_name, M.key) + fingerprintshidden += text("\[[time_stamp()]\] Real name: [], Key: []", M.real_name, M.key) fingerprintslast = M.ckey return //Set ignoregloves to add prints irrespective of the mob having gloves on. -/atom/proc/add_fingerprint(mob/living/M as mob, ignoregloves = 0) - if(isnull(M)) return - if(isnull(M.key)) return +/atom/proc/add_fingerprint(mob/living/M, ignoregloves = FALSE) + if(isnull(M)) + return + if(isnull(M.key)) + return if(ishuman(M)) //Add the list if it does not exist. if(!fingerprintshidden) @@ -456,7 +454,7 @@ if(fingerprintslast != M.key) fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]" fingerprintslast = M.key - return 0 //Now, lets get to the dirty work. + return FALSE //Now, lets get to the dirty work. //First, make sure their DNA makes sense. var/mob/living/carbon/human/H = M if(!istype(H.dna, /datum/dna) || !H.dna.uni_identity || (length(H.dna.uni_identity) != 32)) @@ -469,20 +467,20 @@ if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves if(G.transfer_prints) - ignoregloves = 1 + ignoregloves = TRUE //Now, deal with gloves. if(!ignoregloves) if(H.gloves && H.gloves != src) if(fingerprintslast != H.ckey) - fingerprintshidden += text("\[[]\](Wearing gloves). Real name: [], Key: []",time_stamp(), H.real_name, H.key) + fingerprintshidden += text("\[[]\](Wearing gloves). Real name: [], Key: []", time_stamp(), H.real_name, H.key) fingerprintslast = H.ckey H.gloves.add_fingerprint(M) - return 0 + return FALSE //More adminstuffz if(fingerprintslast != H.ckey) - fingerprintshidden += text("\[[]\]Real name: [], Key: []",time_stamp(), H.real_name, H.key) + fingerprintshidden += text("\[[]\]Real name: [], Key: []", time_stamp(), H.real_name, H.key) fingerprintslast = H.ckey //Make the list if it does not exist. @@ -495,18 +493,16 @@ // Add the fingerprints fingerprints[full_print] = full_print - return 1 + return TRUE else //Smudge up dem prints some if(fingerprintslast != M.ckey) - fingerprintshidden += text("\[[]\]Real name: [], Key: []",time_stamp(), M.real_name, M.key) + fingerprintshidden += text("\[[]\]Real name: [], Key: []", time_stamp(), M.real_name, M.key) fingerprintslast = M.ckey return - -/atom/proc/transfer_fingerprints_to(var/atom/A) - +/atom/proc/transfer_fingerprints_to(atom/A) // Make sure everything are lists. if(!islist(A.fingerprints)) A.fingerprints = list() @@ -553,7 +549,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) /atom/proc/transfer_mob_blood_dna(mob/living/L) var/new_blood_dna = L.get_blood_dna_list() if(!new_blood_dna) - return 0 + return FALSE return transfer_blood_dna(new_blood_dna) /obj/effect/decal/cleanable/blood/splatter/transfer_mob_blood_dna(mob/living/L) @@ -581,14 +577,13 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) var/old_length = blood_DNA.len blood_DNA |= blood_dna if(blood_DNA.len > old_length) - return 1//some new blood DNA was added - + return TRUE//some new blood DNA was added //to add blood from a mob onto something, and transfer their dna info /atom/proc/add_mob_blood(mob/living/M) var/list/blood_dna = M.get_blood_dna_list() if(!blood_dna) - return 0 + return FALSE var/bloodcolor = "#A10808" var/list/b_data = M.get_blood_data(M.get_blood_id()) if(b_data) @@ -598,7 +593,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) //to add blood onto something, with blood dna info to include. /atom/proc/add_blood(list/blood_dna, color) - return 0 + return FALSE /obj/add_blood(list/blood_dna, color) return transfer_blood_dna(blood_dna) @@ -606,10 +601,10 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) /obj/item/add_blood(list/blood_dna, color) var/blood_count = !blood_DNA ? 0 : blood_DNA.len if(!..()) - return 0 + return FALSE if(!blood_count)//apply the blood-splatter overlay if it isn't already in there add_blood_overlay(color) - return 1 //we applied blood to the item + return TRUE //we applied blood to the item /obj/item/clothing/gloves/add_blood(list/blood_dna, color) . = ..() @@ -621,7 +616,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) B = new /obj/effect/decal/cleanable/blood/splatter(src) B.transfer_blood_dna(blood_dna) //give blood info to the blood decal. B.basecolor = color - return 1 //we bloodied the floor + return TRUE //we bloodied the floor /mob/living/carbon/human/add_blood(list/blood_dna, color) if(wear_suit) @@ -652,7 +647,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) verbs += /mob/living/carbon/human/proc/bloody_doodle update_inv_gloves() //handles bloody hands overlays and updating - return 1 + return TRUE /obj/item/proc/add_blood_overlay(color) if(initial(icon) && initial(icon_state)) @@ -690,7 +685,6 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) if(.) transfer_blood = 0 - /obj/item/clothing/shoes/clean_blood() ..() bloody_shoes = list(BLOOD_STATE_HUMAN = 0, BLOOD_STATE_XENO = 0, BLOOD_STATE_NOT_BLOODY = 0) @@ -699,7 +693,6 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) var/mob/M = loc M.update_inv_shoes() - /mob/living/carbon/human/clean_blood() if(gloves) if(gloves.clean_blood()) @@ -713,9 +706,8 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) update_inv_gloves() update_icons() //apply the now updated overlays to the mob - -/atom/proc/add_vomit_floor(toxvomit = 0, green = FALSE) - playsound(src, 'sound/effects/splat.ogg', 50, 1) +/atom/proc/add_vomit_floor(toxvomit = FALSE, green = FALSE) + playsound(src, 'sound/effects/splat.ogg', 50, TRUE) if(!isspaceturf(src)) var/type = green ? /obj/effect/decal/cleanable/vomit/green : /obj/effect/decal/cleanable/vomit var/vomit_reagent = green ? "green_vomit" : "vomit" @@ -728,23 +720,24 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) // Make toxins vomit look different if(toxvomit) - this.icon_state = "vomittox_[pick(1,4)]" + this.icon_state = "vomittox_[pick(1, 4)]" /atom/proc/get_global_map_pos() - if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) return + if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) + return var/cur_x = null var/cur_y = null var/list/y_arr = null - for(cur_x=1,cur_x<=GLOB.global_map.len,cur_x++) + for(cur_x in 1 to GLOB.global_map.len) y_arr = GLOB.global_map[cur_x] cur_y = y_arr.Find(src.z) if(cur_y) break // to_chat(world, "X = [cur_x]; Y = [cur_y]") if(cur_x && cur_y) - return list("x"=cur_x,"y"=cur_y) + return list("x" = cur_x, "y" = cur_y) else - return 0 + return null // Used to provide overlays when using this atom as a viewing focus // (cameras, locker tint, etc.) @@ -757,7 +750,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) return /atom/proc/checkpass(passflag) - return pass_flags&passflag + return pass_flags & passflag /atom/proc/isinspace() if(isspaceturf(get_turf(src))) @@ -800,7 +793,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) return audible_message("[src] [atom_say_verb], \"[message]\"") -/atom/proc/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list()) +/atom/proc/speech_bubble(bubble_state = "", bubble_loc = src, list/bubble_recipients = list()) return /atom/vv_edit_var(var_name, var_value) @@ -857,7 +850,6 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) atom_colours[colour_priority] = coloration update_atom_colour() - /* Removes an instance of colour_type from the atom's atom_colours list */ @@ -872,7 +864,6 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) atom_colours[colour_priority] = null update_atom_colour() - /* Resets the atom's color to null, and then sets it to the highest priority colour available diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index d318302500f..f02e037e8c5 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -116,8 +116,8 @@ Class Procs: var/panel_open = 0 var/area/myArea var/interact_offline = 0 // Can the machine be interacted with while de-powered. - var/use_log = list() - var/list/settagwhitelist = list()//WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST. + var/list/use_log // Init this list if you wish to add logging to your machine - currently only viewable in VV + var/list/settagwhitelist // (Init this list if needed) WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST. atom_say_verb = "beeps" var/siemens_strength = 0.7 // how badly will it shock you? @@ -224,7 +224,7 @@ Class Procs: var/obj/item/multitool/P = get_multitool(usr) if(P && istype(P)) var/update_mt_menu = FALSE - if("set_tag" in href_list) + if("set_tag" in href_list && settagwhitelist) if(!(href_list["set_tag"] in settagwhitelist))//I see you're trying Href exploits, I see you're failing, I SEE ADMIN WARNING. (seriously though, this is a powerfull HREF, I originally found this loophole, I'm not leaving it in on my PR) message_admins("set_tag HREF (var attempted to edit: [href_list["set_tag"]]) exploit attempted by [key_name_admin(user)] on [src] (JMP)") return FALSE diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 951eb79f853..f2816c23f2e 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -1,15 +1,15 @@ /obj //var/datum/module/mod //not used var/origin_tech = null //Used by R&D to determine what research bonuses it grants. - var/crit_fail = 0 + var/crit_fail = FALSE animate_movement = 2 - var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" + var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item - var/sharp = 0 // whether this object cuts - var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! + var/sharp = FALSE // whether this object cuts + var/in_use = FALSE // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! var/damtype = "brute" var/force = 0 - var/list/armor + var/datum/armor/armor var/obj_integrity //defaults to max_integrity var/max_integrity = 500 var/integrity_failure = 0 //0 if we have no special broken behavior @@ -22,9 +22,9 @@ var/can_be_hit = TRUE //can this be bludgeoned by items? - var/Mtoollink = 0 // variable to decide if an object should show the multitool menu linking menu, not all objects use it + var/Mtoollink = FALSE // variable to decide if an object should show the multitool menu linking menu, not all objects use it - var/being_shocked = 0 + var/being_shocked = FALSE var/speed_process = FALSE var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart? @@ -33,8 +33,6 @@ /obj/New() ..() - if(!armor) - armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) if(obj_integrity == null) obj_integrity = max_integrity if(on_blueprints && isturf(loc)) @@ -44,25 +42,34 @@ else T.add_blueprints_preround(src) -/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = GLOB.default_state) +/obj/Initialize() + ..() + if (islist(armor)) + armor = getArmor(arglist(armor)) + else if (!armor) + armor = getArmor() + else if (!istype(armor, /datum/armor)) + stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()") + +/obj/Topic(href, href_list, nowindow = FALSE, datum/topic_state/state = GLOB.default_state) // Calling Topic without a corresponding window open causes runtime errors if(!nowindow && ..()) - return 1 + return TRUE // In the far future no checks are made in an overriding Topic() beyond if(..()) return // Instead any such checks are made in CanUseTopic() if(CanUseTopic(usr, state, href_list) == STATUS_INTERACTIVE) CouldUseTopic(usr) - return 0 + return FALSE CouldNotUseTopic(usr) - return 1 + return TRUE -/obj/proc/CouldUseTopic(var/mob/user) +/obj/proc/CouldUseTopic(mob/user) var/atom/host = nano_host() host.add_fingerprint(user) -/obj/proc/CouldNotUseTopic(var/mob/user) +/obj/proc/CouldNotUseTopic(mob/user) // Nada /obj/Destroy() @@ -93,7 +100,7 @@ else return null -/obj/remove_air(amount) +/obj/remove_air(amount = 0) if(loc) return loc.remove_air(amount) else @@ -105,28 +112,28 @@ else return null -/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request) +/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request = 0) //Return: (NONSTANDARD) // null if object handles breathing logic for lifeform // datum/air_group to tell lifeform to process using that breath return //DEFAULT: Take air from turf to give to have mob process - if(breath_request>0) + if(breath_request > 0) return remove_air(breath_request) else return null /obj/proc/updateUsrDialog() if(in_use) - var/is_in_use = 0 + var/is_in_use = FALSE var/list/nearby = viewers(1, src) for(var/mob/M in nearby) if((M.client && M.machine == src)) - is_in_use = 1 + is_in_use = TRUE src.attack_hand(M) if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) if(!(usr in nearby)) if(usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh. - is_in_use = 1 + is_in_use = TRUE src.attack_ai(usr) // check for TK users @@ -134,8 +141,8 @@ if(istype(usr, /mob/living/carbon/human)) if(istype(usr.l_hand, /obj/item/tk_grab) || istype(usr.r_hand, /obj/item/tk_grab/)) if(!(usr in nearby)) - if(usr.client && usr.machine==src) - is_in_use = 1 + if(usr.client && usr.machine == src) + is_in_use = TRUE src.attack_hand(usr) in_use = is_in_use @@ -143,15 +150,15 @@ // Check that people are actually using the machine. If not, don't update anymore. if(in_use) var/list/nearby = viewers(1, src) - var/is_in_use = 0 + var/is_in_use = FALSE for(var/mob/M in nearby) if((M.client && M.machine == src)) - is_in_use = 1 + is_in_use = TRUE src.interact(M) var/ai_in_use = AutoUpdateAI(src) if(!ai_in_use && !is_in_use) - in_use = 0 + in_use = FALSE /obj/proc/interact(mob/user) return @@ -168,63 +175,63 @@ /atom/movable/proc/on_unset_machine(mob/user) return -/mob/proc/set_machine(var/obj/O) +/mob/proc/set_machine(obj/O) if(src.machine) unset_machine() src.machine = O if(istype(O)) - O.in_use = 1 + O.in_use = TRUE /obj/item/proc/updateSelfDialog() var/mob/M = src.loc if(istype(M) && M.client && M.machine == src) src.attack_self(M) -/obj/proc/hide(h) +/obj/proc/hide(h = FALSE) return - /obj/proc/hear_talk(mob/M, list/message_pieces) return -/obj/proc/hear_message(mob/M as mob, text) +/obj/proc/hear_message(mob/M, text) -/obj/proc/multitool_menu(var/mob/user,var/obj/item/multitool/P) +/obj/proc/multitool_menu(mob/user, obj/item/multitool/P) return "NO MULTITOOL_MENU!" -/obj/proc/linkWith(var/mob/user, var/obj/buffer, var/context) - return 0 +/obj/proc/linkWith(mob/user, obj/buffer, var/context) + return FALSE -/obj/proc/unlinkFrom(var/mob/user, var/obj/buffer) - return 0 +/obj/proc/unlinkFrom(mob/user, obj/buffer) + return FALSE -/obj/proc/canLink(var/obj/O, var/context) - return 0 +/obj/proc/canLink(obj/O, list/context) + return FALSE -/obj/proc/isLinkedWith(var/obj/O) - return 0 +/obj/proc/isLinkedWith(obj/O) + return FALSE -/obj/proc/getLink(var/idx) +/obj/proc/getLink(idx) return null -/obj/proc/linkMenu(var/obj/O) - var/dat="" +/obj/proc/linkMenu(obj/O) + var/dat = "" if(canLink(O, list())) dat += " \[Link\] " return dat -/obj/proc/format_tag(var/label,var/varname, var/act="set_tag") +/obj/proc/format_tag(label = "", varname = "", act = "set_tag") var/value = vars[varname] - if(!value || value=="") - value="-----" + if(!value || value == "") + value = "-----" return "[label]: [value]" -/obj/proc/update_multitool_menu(mob/user as mob) +/obj/proc/update_multitool_menu(mob/user) var/obj/item/multitool/P = get_multitool(user) if(!istype(P)) - return 0 + return FALSE + var/dat = {"
MULTITOOL BUFFER: [P.buffer] [id ? "([id])" : ""]" dat += linkMenu(P.buffer) @@ -301,20 +308,20 @@ a { return TRUE return FALSE -/obj/water_act(volume, temperature, source, method = REAGENT_TOUCH) +/obj/water_act(volume = 0, temperature = 0, source, method = REAGENT_TOUCH) . = ..() extinguish() acid_level = 0 -/obj/singularity_pull(S, current_size) +/obj/singularity_pull(S, current_size = 0) ..() if(!anchored || current_size >= STAGE_FIVE) - step_towards(src,S) + step_towards(src, S) -/obj/proc/container_resist(var/mob/living) +/obj/proc/container_resist(mob/living) return -/obj/proc/CanAStarPass() +/obj/proc/CanAStarPass(ID, dir, caller) . = !density /obj/proc/on_mob_move(dir, mob/user) @@ -343,4 +350,4 @@ a { .["Make normal process"] = "?_src_=vars;makenormalspeed=[UID()]" /obj/proc/check_uplink_validity() - return 1 + return TRUE diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index defd6720e7d..0cfa8ccc891 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -3,7 +3,7 @@ level = 1 luminosity = 1 - var/intact = 1 + var/intact = TRUE var/turf/baseturf = /turf/space var/slowdown = 0 //negative for faster, positive for slower @@ -30,7 +30,7 @@ var/list/blueprint_data //for the station blueprints, images of objects eg: pipes - var/list/footstep_sounds = list() + var/list/footstep_sounds var/shoe_running_volume = 50 var/shoe_walking_volume = 20 @@ -65,7 +65,7 @@ if(AA.smooth) queue_smooth(AA) log_startup_progress(" Smoothed atoms in [stop_watch(watch)]s.") - return 1 + return TRUE /turf/Destroy() // Adds the adjacent turfs to the current atmos processing @@ -82,7 +82,7 @@ user.Move_Pulled(src) /turf/ex_act(severity) - return 0 + return FALSE /turf/rpd_act(mob/user, obj/item/rpd/our_rpd) //This is the default turf behaviour for the RPD; override it as required if(our_rpd.mode == RPD_ATMOS_MODE) @@ -100,55 +100,53 @@ else if(our_rpd.mode == RPD_DELETE_MODE) our_rpd.delete_all_pipes(user, src) -/turf/bullet_act(var/obj/item/projectile/Proj) - if(istype(Proj ,/obj/item/projectile/beam/pulse)) +/turf/bullet_act(obj/item/projectile/Proj) + if(istype(Proj, /obj/item/projectile/beam/pulse)) src.ex_act(2) ..() - return 0 + return FALSE -/turf/bullet_act(var/obj/item/projectile/Proj) - if(istype(Proj ,/obj/item/projectile/bullet/gyro)) +/turf/bullet_act(obj/item/projectile/Proj) + if(istype(Proj, /obj/item/projectile/bullet/gyro)) explosion(src, -1, 0, 2) ..() - return 0 + return FALSE -/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area) +/turf/Enter(atom/movable/mover as mob|obj, atom/forget) if(!mover) - return 1 - + return TRUE // First, make sure it can leave its square if(isturf(mover.loc)) // Nothing but border objects stop you from leaving a tile, only one loop is needed for(var/obj/obstacle in mover.loc) if(!obstacle.CheckExit(mover, src) && obstacle != mover && obstacle != forget) - mover.Bump(obstacle, 1) - return 0 + mover.Bump(obstacle, TRUE) + return FALSE var/list/large_dense = list() //Next, check objects to block entry that are on the border for(var/atom/movable/border_obstacle in src) - if(border_obstacle.flags&ON_BORDER) - if(!border_obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != border_obstacle)) - mover.Bump(border_obstacle, 1) - return 0 + if(border_obstacle.flags & ON_BORDER) + if(!border_obstacle.CanPass(mover, mover.loc, 1) && (forget != border_obstacle)) + mover.Bump(border_obstacle, TRUE) + return FALSE else large_dense += border_obstacle //Then, check the turf itself if(!src.CanPass(mover, src)) - mover.Bump(src, 1) - return 0 + mover.Bump(src, TRUE) + return FALSE //Finally, check objects/mobs to block entry that are not on the border for(var/atom/movable/obstacle in large_dense) - if(!obstacle.CanPass(mover, mover.loc, 1, 0) && (forget != obstacle)) - mover.Bump(obstacle, 1) - return 0 - return 1 //Nothing found to block so return success! + if(!obstacle.CanPass(mover, mover.loc, 1) && (forget != obstacle)) + mover.Bump(obstacle, TRUE) + return FALSE + return TRUE //Nothing found to block so return success! - -/turf/Entered(atom/movable/M, atom/OL, ignoreRest = 0) +/turf/Entered(atom/movable/M, atom/OL, ignoreRest = FALSE) ..() if(ismob(M)) var/mob/O = M @@ -161,7 +159,7 @@ if(loopsanity == 0) break loopsanity-- - A.HasProximity(M, 1) + A.HasProximity(M) // If an opaque movable atom moves around we need to potentially update visibility. if(M.opacity) @@ -177,7 +175,7 @@ /turf/space/levelupdate() for(var/obj/O in src) if(O.level == 1) - O.hide(0) + O.hide(FALSE) // Removes all signs of lattice on the pos of the turf -Donkieyo /turf/proc/RemoveLattice() @@ -247,7 +245,7 @@ return // I'm including `ignore_air` because BYOND lacks positional-only arguments -/turf/proc/AfterChange(ignore_air, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf() +/turf/proc/AfterChange(ignore_air = FALSE, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf() levelupdate() CalculateAdjacentTurfs() @@ -258,7 +256,7 @@ for(var/obj/structure/cable/C in contents) qdel(C) -/turf/simulated/AfterChange(ignore_air, keep_cabling = FALSE) +/turf/simulated/AfterChange(ignore_air = FALSE, keep_cabling = FALSE) ..() RemoveLattice() if(!ignore_air) @@ -275,11 +273,11 @@ var/turf_count = 0 for(var/direction in GLOB.cardinal)//Only use cardinals to cut down on lag - var/turf/T = get_step(src,direction) - if(istype(T,/turf/space))//Counted as no air + var/turf/T = get_step(src, direction) + if(istype(T, /turf/space))//Counted as no air turf_count++//Considered a valid turf for air calcs continue - else if(istype(T,/turf/simulated/floor)) + else if(istype(T, /turf/simulated/floor)) var/turf/simulated/S = T if(S.air)//Add the air's contents to the holders aoxy += S.air.oxygen @@ -288,11 +286,11 @@ atox += S.air.toxins atemp += S.air.temperature turf_count++ - air.oxygen = (aoxy/max(turf_count,1))//Averages contents of the turfs, ignoring walls and the like - air.nitrogen = (anitro/max(turf_count,1)) - air.carbon_dioxide = (aco/max(turf_count,1)) - air.toxins = (atox/max(turf_count,1)) - air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant + air.oxygen = (aoxy/max(turf_count, 1))//Averages contents of the turfs, ignoring walls and the like + air.nitrogen = (anitro/max(turf_count, 1)) + air.carbon_dioxide = (aco/max(turf_count, 1)) + air.toxins = (atox/max(turf_count, 1)) + air.temperature = (atemp/max(turf_count, 1))//Trace gases can get bant if(SSair) SSair.add_to_active(src) @@ -306,12 +304,11 @@ /turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N //Useful to batch-add creatures to the list. for(var/mob/living/M in src) - if(M==U) continue//Will not harm U. Since null != M, can be excluded to kill everyone. - spawn(0) - M.gib() + if(M == U) + continue//Will not harm U. Since null != M, can be excluded to kill everyone. + addtimer(CALLBACK(M, /mob/.proc/gib), 0) for(var/obj/mecha/M in src)//Mecha are not gibbed but are damaged. - spawn(0) - M.take_damage(100, "brute") + addtimer(CALLBACK(M, /obj/mecha/.proc/take_damage, 100, "brute"), 0) /turf/proc/Bless() flags |= NOJAUNT @@ -368,11 +365,11 @@ // Returns the surrounding simulated turfs with open links // Including through doors openable with the ID -/turf/proc/AdjacentTurfsWithAccess(var/obj/item/card/id/ID = null,var/list/closed)//check access if one is passed +/turf/proc/AdjacentTurfsWithAccess(obj/item/card/id/ID = null, list/closed)//check access if one is passed var/list/L = new() var/turf/simulated/T - for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties - T = get_step(src,dir) + for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties + T = get_step(src, dir) if(T in closed) //turf already proceeded in A* continue if(istype(T) && !T.density) @@ -381,11 +378,11 @@ return L //Idem, but don't check for ID and goes through open doors -/turf/proc/AdjacentTurfs(var/list/closed) +/turf/proc/AdjacentTurfs(list/closed) var/list/L = new() var/turf/simulated/T - for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties - T = get_step(src,dir) + for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties + T = get_step(src, dir) if(T in closed) //turf already proceeded by A* continue if(istype(T) && !T.density) @@ -394,11 +391,11 @@ return L // check for all turfs, including unsimulated ones -/turf/proc/AdjacentTurfsSpace(var/obj/item/card/id/ID = null, var/list/closed)//check access if one is passed +/turf/proc/AdjacentTurfsSpace(obj/item/card/id/ID = null, list/closed)//check access if one is passed var/list/L = new() var/turf/T - for(var/dir in list(NORTHWEST,NORTHEAST,SOUTHEAST,SOUTHWEST,NORTH,EAST,SOUTH,WEST)) //arbitrarily ordered list to favor non-diagonal moves in case of ties - T = get_step(src,dir) + for(var/dir in GLOB.alldirs2) //arbitrarily ordered list to favor non-diagonal moves in case of ties + T = get_step(src, dir) if(T in closed) //turf already proceeded by A* continue if(istype(T) && !T.density) @@ -415,20 +412,21 @@ ////////////////////////////// //Distance associates with all directions movement -/turf/proc/Distance(var/turf/T) - return get_dist(src,T) +/turf/proc/Distance(turf/T) + return get_dist(src, T) // This Distance proc assumes that only cardinal movement is // possible. It results in more efficient (CPU-wise) pathing // for bots and anything else that only moves in cardinal dirs. /turf/proc/Distance_cardinal(turf/T) - if(!src || !T) return 0 + if(!src || !T) + return 0 return abs(src.x - T.x) + abs(src.y - T.y) //////////////////////////////////////////////////// /turf/acid_act(acidpwr, acid_volume) - . = 1 + . = TRUE var/acid_type = /obj/effect/acid if(acidpwr >= 200) //alien acid power acid_type = /obj/effect/acid/alien @@ -453,7 +451,7 @@ if(!forced) return if(has_gravity(src)) - playsound(src, "bodyfall", 50, 1) + playsound(src, "bodyfall", 50, TRUE) /turf/singularity_act() if(intact) @@ -463,7 +461,7 @@ if(O.invisibility == INVISIBILITY_MAXIMUM) O.singularity_act() ChangeTurf(baseturf) - return(2) + return 2 /turf/proc/visibilityChanged() if(SSticker) @@ -474,25 +472,25 @@ if(istype(I, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = I for(var/obj/structure/cable/LC in src) - if(LC.d1 == 0 || LC.d2==0) - LC.attackby(C,user) + if(LC.d1 == 0 || LC.d2 == 0) + LC.attackby(C, user) return C.place_turf(src, user) - return 1 + return TRUE else if(istype(I, /obj/item/twohanded/rcl)) var/obj/item/twohanded/rcl/R = I if(R.loaded) for(var/obj/structure/cable/LC in src) - if(LC.d1 == 0 || LC.d2==0) + if(LC.d1 == 0 || LC.d2 == 0) LC.attackby(R, user) return R.loaded.place_turf(src, user) R.is_empty(user) - return 0 + return FALSE /turf/proc/can_have_cabling() - return 1 + return TRUE /turf/proc/can_lay_cable() return can_have_cabling() & !intact @@ -528,7 +526,7 @@ if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING) add_blueprints(AM) -/turf/proc/empty(turf_type=/turf/space) +/turf/proc/empty(turf_type = /turf/space) // Remove all atoms except observers, landmarks, docking ports, and (un)`simulated` atoms (lighting overlays) var/turf/T0 = src for(var/X in T0.GetAllContents()) @@ -541,13 +539,13 @@ continue if(istype(A, /obj/docking_port)) continue - qdel(A, force=TRUE) + qdel(A, force = TRUE) T0.ChangeTurf(turf_type) SSair.remove_from_active(T0) T0.CalculateAdjacentTurfs() - SSair.add_to_active(T0,1) + SSair.add_to_active(T0, TRUE) /turf/AllowDrop() return TRUE diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 247e0bcbab2..b12f62623e8 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -226,7 +226,7 @@ Des: Removes all infected images from the alien. /mob/living/carbon/alien/handle_footstep(turf/T) if(..()) - if(T.footstep_sounds["xeno"]) + if(T.footstep_sounds && T.footstep_sounds["xeno"]) var/S = pick(T.footstep_sounds["xeno"]) if(S) if(m_intent == MOVE_INTENT_RUN) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 85bf001a206..5e1b5163a24 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -81,7 +81,7 @@ /mob/living/carbon/human/handle_footstep(turf/T) if(..()) - if(T.footstep_sounds["human"]) + if(T.footstep_sounds && T.footstep_sounds["human"]) var/S = pick(T.footstep_sounds["human"]) if(S) if(m_intent == MOVE_INTENT_RUN) diff --git a/paradise.dme b/paradise.dme index b83ea6be6df..36a76636b03 100644 --- a/paradise.dme +++ b/paradise.dme @@ -260,6 +260,7 @@ #include "code\datums\action.dm" #include "code\datums\ai_law_sets.dm" #include "code\datums\ai_laws.dm" +#include "code\datums\armor.dm" #include "code\datums\beam.dm" #include "code\datums\browser.dm" #include "code\datums\callback.dm"