diff --git a/baystation12.dme b/baystation12.dme
index 677397a248c..3d156afe557 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -356,7 +356,6 @@
#include "code\defines\procs\logging.dm"
#include "code\defines\procs\religion_name.dm"
#include "code\defines\procs\station_name.dm"
-#include "code\defines\procs\statistics.dm"
#include "code\defines\procs\syndicate_name.dm"
#include "code\defines\procs\time_stamp.dm"
#include "code\defines\sd_procs\base64.dm"
diff --git a/code/WorkInProgress/SkyMarshal/Ultralight.dm b/code/WorkInProgress/SkyMarshal/Ultralight.dm
index dadc5c2ec2d..1f992cff63b 100644
--- a/code/WorkInProgress/SkyMarshal/Ultralight.dm
+++ b/code/WorkInProgress/SkyMarshal/Ultralight.dm
@@ -214,7 +214,7 @@ atom/proc/ul_BlankLocal()
var/TurfAdjust = isturf(src) ? 1 : 0
for(var/atom/Affected in view(ul_TopLuminosity, src))
- if(ul_IsLuminous(Affected) && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= Affected.luminosity + TurfAdjust))
+ if(ul_IsLuminous(Affected) && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= ul_Luminosity(Affected) + TurfAdjust))
Affected.ul_Extinguish()
Blanked += Affected
diff --git a/code/ZAS/FEA_system.dm b/code/ZAS/FEA_system.dm
index fcd71dbff51..8c121b88fa4 100644
--- a/code/ZAS/FEA_system.dm
+++ b/code/ZAS/FEA_system.dm
@@ -162,7 +162,7 @@ datum
if(!success) //Runtimed.
failed_ticks++
if(failed_ticks > 20)
- world << "ERROR IN ATMOS TICKER. Killing air simulation!"
+ world << "ERROR IN ATMOS TICKER. Killing air simulation!"
kill_air = 1
sleep(max(5,update_delay*tick_multiplier))
diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm
index 5f68402197f..abc41257458 100644
--- a/code/datums/ai_laws.dm
+++ b/code/datums/ai_laws.dm
@@ -93,8 +93,9 @@
src.inherent = list()
/datum/ai_laws/proc/add_supplied_law(var/number, var/law)
- while (src.supplied.len < number + 1)
- src.supplied += ""
+// while (src.supplied.len < number + 1)
+// src.supplied += ""
+//Infinite loop
src.supplied[number + 1] = law
diff --git a/code/datums/diseases/robotic_transformation.dm b/code/datums/diseases/robotic_transformation.dm
index 34b074e34f4..8692ef54467 100644
--- a/code/datums/diseases/robotic_transformation.dm
+++ b/code/datums/diseases/robotic_transformation.dm
@@ -53,7 +53,7 @@
affected_mob.updatehealth()
if(prob(40)) //So everyone can feel like robot Seth Brundle
if(src.gibbed != 0) return 0
- var/turf/T = find_loc(affected_mob)
+ var/turf/T = get_turf(affected_mob)
gibs(T)
src.cure(0)
gibbed = 1
diff --git a/code/datums/diseases/xeno_transformation.dm b/code/datums/diseases/xeno_transformation.dm
index 9d3289708ff..09e3f20e77a 100644
--- a/code/datums/diseases/xeno_transformation.dm
+++ b/code/datums/diseases/xeno_transformation.dm
@@ -53,7 +53,7 @@
affected_mob.updatehealth()
if(prob(40))
if(gibbed != 0) return 0
- var/turf/T = find_loc(affected_mob)
+ var/turf/T = get_turf(affected_mob)
gibs(T)
src.cure(0)
gibbed = 1
diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm
index 7c2fabbc9b8..e3f64704143 100644
--- a/code/datums/helper_datums/construction_datum.dm
+++ b/code/datums/helper_datums/construction_datum.dm
@@ -46,11 +46,11 @@
proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
- var/list/L = steps[i];
+ var/list/L = steps[i]
if(istype(used_atom, L["key"]))
if(custom_action(i, used_atom, user))
- steps[i]=null;//stupid byond list from list removal...
- listclearnulls(steps);
+ steps[i]=null//stupid byond list from list removal...
+ steps.Remove(null)
if(!steps.len)
spawn_result()
return 1
diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm
index b6aecf27c81..f157909ff62 100644
--- a/code/datums/helper_datums/teleport.dm
+++ b/code/datums/helper_datums/teleport.dm
@@ -172,7 +172,8 @@
if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("\red The [teleatom] bounces off of the portal!")
return 0
- if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
+ var/list/temp = teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)
+ if(temp.len)
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
MM.visible_message("\red The [MM] bounces off of the portal!","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.")
diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm
index 36b2f8e52c0..341d5944b5a 100644
--- a/code/defines/procs/helpers.dm
+++ b/code/defines/procs/helpers.dm
@@ -1152,17 +1152,6 @@ proc/islist(list/list)
return 1
return 0
-proc/isemptylist(list/list)
- if(!list.len)
- return 1
- return 0
-
-proc/listclearnulls(list/list)
- if(istype(list))
- while(null in list)
- list -= null
- return
-
/atom/proc/GetAllContents(searchDepth = 5)
var/list/toReturn = list()
diff --git a/code/game/communications.dm b/code/game/communications.dm
index 012fe5419ec..015a56d871f 100644
--- a/code/game/communications.dm
+++ b/code/game/communications.dm
@@ -240,9 +240,8 @@ datum/radio_frequency
for (var/devices_filter in devices)
var/list/devices_line = devices[devices_filter]
devices_line-=device
- while (null in devices_line)
- devices_line -= null
- if (devices_line.len==0)
+ devices_line.Remove(null)
+ if (!devices_line.len)
devices -= devices_filter
del(devices_line)
diff --git a/code/game/events/Events/BlowOut.dm b/code/game/events/Events/BlowOut.dm
index 89945d33fcb..1d660989d96 100644
--- a/code/game/events/Events/BlowOut.dm
+++ b/code/game/events/Events/BlowOut.dm
@@ -23,9 +23,7 @@
command_alert("Station has entered radiation cloud. Do not leave cover until it has passed.")
if(ActiveFor == 100 || ActiveFor == 150) //1/2 and 2/2 f the way after it start proper make peope be half dead mostly
for(var/mob/living/carbon/M in world)
- var/area = M.loc.loc
- while(!istype(area, /area))
- area = area:loc
+ var/area = get_area(M)
if(area:radsafe)
continue
if(!M.stat)
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 83281a5894c..17117546896 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -136,9 +136,9 @@ var/datum/roundinfo/roundinfo = new()
//Start master_controller.process()
spawn master_controller.process()
- if (config.sql_enabled)
- spawn(3000)
- statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
+// if (config.sql_enabled)
+// spawn(3000)
+// statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
return 1
/datum/controller/gameticker
diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm
index 5614dcc7826..a40aa01d400 100644
--- a/code/game/machinery/bots/ed209bot.dm
+++ b/code/game/machinery/bots/ed209bot.dm
@@ -753,13 +753,9 @@ Auto Patrol: []"},
if(lastfired && world.time - lastfired < shot_delay)
return
lastfired = world.time
- var/turf/T = loc
- var/atom/U = (istype(target, /atom/movable) ? target.loc : target)
- if ((!( U ) || !( T )))
- return
- while(!( istype(U, /turf) ))
- U = U.loc
- if (!( istype(T, /turf) ))
+ var/turf/T = get_turf(src)
+ var/turf/U = (istype(target, /atom/movable) ? get_turf(target) : target)
+ if ( !istype(T) || !istype(U) )
return
//if(lastfired && world.time - lastfired < 100)
@@ -767,31 +763,25 @@ Auto Patrol: []"},
var/obj/item/projectile/A
if(!lasercolor)
- if (src.emagged)
- A = new /obj/item/projectile/beam( loc )
+ if (emagged)
+ A = new /obj/item/projectile/beam( T )
else
- A = new /obj/item/projectile/energy/electrode( loc )
+ A = new /obj/item/projectile/energy/electrode( T )
else if(lasercolor == "b")
- if (src.emagged)
- A = new /obj/item/projectile/energy/electrode( loc )
+ if (emagged)
+ A = new /obj/item/projectile/energy/electrode( T )
else
- A = new /obj/item/projectile/bluetag( loc )
+ A = new /obj/item/projectile/bluetag( T )
else if(lasercolor == "r")
- if (src.emagged)
- A = new /obj/item/projectile/energy/electrode( loc )
+ if (emagged)
+ A = new /obj/item/projectile/energy/electrode( T )
else
- A = new /obj/item/projectile/redtag( loc )
-
- if (!( istype(U, /turf) ))
- //A = null
- del(A)
- return
+ A = new /obj/item/projectile/redtag( T )
A.current = U
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 0 )
- A.process()
- return
+ A.fired()
return
/obj/machinery/bot/ed209/attack_alien(var/mob/living/carbon/alien/user as mob)
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 0dc206a0085..151b75843be 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -174,7 +174,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="
The newscaster recognises you as: [src.scanned_user]"
if(1)
dat+= "Station Feed Channels
"
- if( isemptylist(src.channel_list) )
+ if(channel_list.len)
dat+="No active channels found..."
else
for(var/datum/feed_channel/CHANNEL in src.channel_list)
@@ -255,7 +255,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
"
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
else
- if( isemptylist(src.viewing_channel.messages) )
+ if(!viewing_channel.messages.len)
dat+="No feed messages found in channel...
"
else
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
@@ -267,7 +267,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
"
dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it."
dat+="
Select Feed channel to get Stories from:
"
- if(isemptylist(src.channel_list))
+ if(!channel_list.len)
dat+="No feed channels found active...
"
else
for(var/datum/feed_channel/CHANNEL in src.channel_list)
@@ -278,7 +278,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's"
dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed"
dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
"
- if(isemptylist(src.channel_list))
+ if(channel_list.len)
dat+="No feed channels found active...
"
else
for(var/datum/feed_channel/CHANNEL in src.channel_list)
@@ -290,7 +290,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="[(src.viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]
"
- if( isemptylist(src.viewing_channel.messages) )
+ if( !viewing_channel.messages.len )
dat+="No feed messages found in channel...
"
else
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
@@ -304,7 +304,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
"
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
else
- if( isemptylist(src.viewing_channel.messages) )
+ if( !viewing_channel.messages.len )
dat+="No feed messages found in channel...
"
else
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
@@ -685,7 +685,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob)
if(0) //Cover
dat+="The Griffon
"
dat+="Nanotrasen-standard newspaper, for use on Nanotrasen© Space Facilities
"
- if(isemptylist(src.news_content))
+ if(!news_content.len)
if(src.important_message)
dat+="Contents:
**Important Security Announcement** \[page [src.pages+2]\]
"
else
@@ -712,7 +712,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob)
if(C.censored)
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing."
else
- if(isemptylist(C.messages))
+ if(!C.messages.len)
dat+="No Feed stories stem from this channel..."
else
dat+=""
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 1fec2e76069..9ddf4658776 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -105,14 +105,6 @@
src.id = t
return
-/proc/find_loc(obj/R as obj)
- if (!R) return null
- var/turf/T = R.loc
- while(!istype(T, /turf))
- T = T.loc
- if(!T || istype(T, /area)) return null
- return T
-
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
spawn()
if (src.icon_state == "tele1")
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 63ff42adc98..2bdd535798f 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -477,6 +477,7 @@
var/health = 40
var/list/scan_for = list("human"=0,"cyborg"=0,"mecha"=0,"alien"=1)
var/on = 0
+ var/processing = 0 //So we dun get dozens of duplicate while loops
icon = 'turrets.dmi'
icon_state = "gun_turret"
@@ -567,16 +568,20 @@
process()
- spawn while(on)
- if(projectiles<=0)
- on = 0
- return
- if(cur_target && !validate_target(cur_target))
- cur_target = null
- if(!cur_target)
- cur_target = get_target()
- fire(cur_target)
- sleep(cooldown)
+ if(!processing)
+ spawn
+ while(on)
+ processing = 1
+ if(projectiles<=0)
+ on = 0
+ return
+ if(cur_target && !validate_target(cur_target))
+ cur_target = null
+ if(!cur_target)
+ cur_target = get_target()
+ fire(cur_target)
+ sleep(cooldown)
+ processing = 0
return
proc/get_target()
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index c253e07569c..5115bdd2d8b 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -47,7 +47,7 @@
/obj/item/mecha_parts/mecha_equipment/proc/destroy()//missiles detonating, teleporter creating singularity?
if(chassis)
chassis.equipment -= src
- listclearnulls(chassis.equipment)
+ chassis.equipment.Remove(null)
if(chassis.selected == src)
chassis.selected = null
src.update_chassis_page()
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index b4311815a44..0d284d8ed25 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -721,7 +721,7 @@
del(src)
return 1
else
- user << "\red You can't load the [src.name] while it's opened."
+ user << "\red You can't load \the [src] while it's opened."
return 1
if(istype(W, /obj/item/weapon/card/emag))
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 559cb3efb27..6d3318db606 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -350,7 +350,7 @@
///////////////////////////////////
/obj/mecha/proc/check_for_internal_damage(var/list/possible_int_damage,var/ignore_threshold=null)
- if(!islist(possible_int_damage) || isemptylist(possible_int_damage)) return
+ if(!islist(possible_int_damage) || !possible_int_damage.len) return
if(prob(20))
if(ignore_threshold || src.health*100/initial(src.health) 1 || prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index f319ebe5019..d943bca690d 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -165,16 +165,10 @@ var/intercom_range_display_status = 0
for(var/atom/A in world)
if(istype(A,type_path))
- var/atom/B = A
- while(!(isturf(B.loc)))
- if(B && B.loc)
- B = B.loc
- else
- break
- if(B)
- if(B.z == num_level)
- count++
- atom_list += A
+ var/turf/B = get_turf(A)
+ if(istype(B) && B.z == num_level)
+ count++
+ atom_list += A
/*
var/atom/temp_atom
for(var/i = 0; i <= (atom_list.len/10); i++)
diff --git a/code/modules/maps/reader.dm b/code/modules/maps/reader.dm
index 8bd9179cfdb..6d520a30b21 100644
--- a/code/modules/maps/reader.dm
+++ b/code/modules/maps/reader.dm
@@ -1,60 +1,59 @@
-dmm_suite{
- load_map(var/dmm_file as file, var/z_offset as num){
- if(!z_offset){
+dmm_suite
+ load_map(var/dmm_file as file, var/z_offset as num)
+ if(!z_offset)
z_offset = world.maxz+1
- }
var/quote = ascii2text(34)
var/tfile = file2text(dmm_file)
var/tfile_len = length(tfile)
var/list/grid_models[0]
var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))
- for(var/lpos=1;lposlength(zgrid)){break}
+ if(gpos+length(grid_line)+1>length(zgrid))
+ break
sleep(-1)
- }
- if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len){break}
+ if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len)
+ break
sleep(-1)
- }
- }
- proc{
- parse_grid(var/model as text,var/xcrd as num,var/ycrd as num,var/zcrd as num){
+ proc
+ parse_grid(var/model as text,var/xcrd as num,var/ycrd as num,var/zcrd as num)
/*Method parse_grid()
- Accepts a text string containing a comma separated list of type paths of the
same construction as those contained in a .dmm file, and instantiates them.
*/
var/list/text_strings[0]
- for(var/index=1;findtext(model,quote);index++){
+ for(var/index=1;findtext(model,quote);index++)
/*Loop: Stores quoted portions of text in text_strings, and replaces them with an
index to that list.
- Each iteration represents one quoted section of text.
@@ -63,7 +62,6 @@ dmm_suite{
text_strings[index] = copytext(model,findtext(model,quote)+1,findtext(model,quote,findtext(model,quote)+1,0))
model = copytext(model,1,findtext(model,quote))+"~[index]"+copytext(model,findtext(model,quote,findtext(model,quote)+1,0)+1,0)
sleep(-1)
- }
var/list/old_turf_underlays[0]
var/old_turf_density
var/old_turf_opacity
@@ -71,118 +69,104 @@ dmm_suite{
This is done to approximate the layered turf effect of DM's map editor.
An image of each turf is stored in old_turf_underlays[], and is later added to the new turf's underlays.
*/
- for(var/dpos=1;dpos!=0;dpos=findtext(model,",",dpos,0)+1){
+ for(var/dpos=1;dpos!=0;dpos=findtext(model,",",dpos,0)+1)
/*Loop: Identifies each object's data, instantiates it, and reconstitues it's fields.
- Each iteration represents one object's data, including type path and field values.
*/
var/full_def = copytext(model,dpos,findtext(model,",",dpos,0))
var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))
var/list/attributes[0]
- if(findtext(full_def,"{")){
+ if(findtext(full_def,"{"))
full_def = copytext(full_def,1,length(full_def))
- for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1){
+ for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1)
//Loop: Identifies each attribute/value pair, and stores it in attributes[].
attributes.Add(copytext(full_def,apos,findtext(full_def,";",apos,0)))
- if(!findtext(copytext(full_def,apos,0),";")){break}
+ if(!findtext(copytext(full_def,apos,0),";"))
+ break
sleep(-1)
- }
- }
//Construct attributes associative list
var/list/fields = new(0)
- for(var/index=1;index<=attributes.len;index++){
+ for(var/index=1;index<=attributes.len;index++)
var/trim_left = trim_text(copytext(attributes[index],1,findtext(attributes[index],"=")))
var/trim_right = trim_text(copytext(attributes[index],findtext(attributes[index],"=")+1,0))
//Check for string
- if(findtext(trim_right,"~")){
+ if(findtext(trim_right,"~"))
var/reference_index = copytext(trim_right,findtext(trim_right,"~")+1,0)
trim_right=text_strings[text2num(reference_index)]
- }
//Check for number
- else if(isnum(text2num(trim_right))){
+ else if(isnum(text2num(trim_right)))
trim_right = text2num(trim_right)
- }
//Check for file
- else if(copytext(trim_right,1,2) == "'"){
+ else if(copytext(trim_right,1,2) == "'")
trim_right = file(copytext(trim_right,2,length(trim_right)))
- }
fields[trim_left] = trim_right
- }
//End construction
//Begin Instanciation
var/atom/instance
var/dmm_suite/preloader/_preloader = new(fields)
- if(ispath(atom_def,/area)){
+ if(ispath(atom_def,/area))
instance = locate(atom_def)
instance.contents.Add(locate(xcrd,ycrd,zcrd))
- }
- else if(ispath(atom_def,/turf)){
+ else if(ispath(atom_def,/turf))
var/turf/old_turf = locate(xcrd,ycrd,zcrd)
if(old_turf.density){old_turf_density = 1}
if(old_turf.opacity){old_turf_opacity = 1}
- if(old_turf.icon){
+ if(old_turf.icon)
var/image/old_turf_image = image(old_turf.icon,null,old_turf.icon_state,old_turf.layer,old_turf.dir)
old_turf_underlays.Add(old_turf_image)
- }
instance = new atom_def(old_turf, _preloader)
- for(var/inverse_index=old_turf_underlays.len;inverse_index;inverse_index--){
+ for(var/inverse_index=old_turf_underlays.len;inverse_index;inverse_index--)
var/image/image_underlay = old_turf_underlays[inverse_index]
image_underlay.loc = instance
instance.underlays.Add(image_underlay)
- }
- if(!instance.density){instance.density = old_turf_density}
- if(!instance.opacity){instance.opacity = old_turf_opacity}
- }
+ if(!instance.density)
+ instance.density = old_turf_density
+ if(!instance.opacity)
+ instance.opacity = old_turf_opacity
- if(_preloader && instance){
+ if(_preloader && instance)
_preloader.load(instance)
- }
//End Instanciation
- if(!findtext(copytext(model,dpos,0),",")){break}
+ if(!findtext(copytext(model,dpos,0),","))
+ break
sleep(-1)
- }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
for(var/dpos=1;dpos!=0;dpos=findtext(model,",",dpos,0)+1)
- {
/*Loop: Identifies each object's data, instantiates it, and reconstitues it's fields.
- Each iteration represents one object's data, including type path and field values.
*/
var/full_def = copytext(model,dpos,findtext(model,",",dpos,0))
var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))
var/list/attributes[0]
- if(findtext(full_def,"{")){
+ if(findtext(full_def,"{"))
full_def = copytext(full_def,1,length(full_def))
- for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1){
+ for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1)
//Loop: Identifies each attribute/value pair, and stores it in attributes[].
attributes.Add(copytext(full_def,apos,findtext(full_def,";",apos,0)))
- if(!findtext(copytext(full_def,apos,0),";")){break}
+ if(!findtext(copytext(full_def,apos,0),";"))
+ break
sleep(-1)
- }
- }
//Construct attributes associative list
var/list/fields = new(0)
- for(var/index=1;index<=attributes.len;index++){
+ for(var/index=1;index<=attributes.len;index++)
var/trim_left = trim_text(copytext(attributes[index],1,findtext(attributes[index],"=")))
var/trim_right = trim_text(copytext(attributes[index],findtext(attributes[index],"=")+1,0))
//Check for string
- if(findtext(trim_right,"~")){
+ if(findtext(trim_right,"~"))
var/reference_index = copytext(trim_right,findtext(trim_right,"~")+1,0)
trim_right=text_strings[text2num(reference_index)]
- }
//Check for number
- else if(isnum(text2num(trim_right))){
+ else if(isnum(text2num(trim_right)))
trim_right = text2num(trim_right)
- }
//Check for file
- else if(copytext(trim_right,1,2) == "'"){
+ else if(copytext(trim_right,1,2) == "'")
trim_right = file(copytext(trim_right,2,length(trim_right)))
- }
fields[trim_left] = trim_right
- }
//End construction
@@ -190,60 +174,42 @@ dmm_suite{
var/atom/instance
var/dmm_suite/preloader/_preloader = new(fields)
if(!ispath(atom_def,/area) && !ispath(atom_def,/turf))
- {
instance = new atom_def(locate(xcrd,ycrd,zcrd), _preloader)
- }
if(_preloader && instance)
- {
_preloader.load(instance)
- }
//End Instanciation
- if(!findtext(copytext(model,dpos,0),",")){break}
+ if(!findtext(copytext(model,dpos,0),","))
+ break
sleep(-1)
- }
-
- }
- trim_text(var/what as text){
- while(length(what) && findtext(what," ",1,2)){
+ trim_text(var/what as text)
+ while(length(what) && findtext(what," ",1,2))
what=copytext(what,2,0)
- }
- while(length(what) && findtext(what," ",length(what),0)){
+ while(length(what) && findtext(what," ",length(what),0))
what=copytext(what,1,length(what))
- }
return what
- }
- }
- }
-atom/New(atom/loc, dmm_suite/preloader/_dmm_preloader){
- if(istype(_dmm_preloader, /dmm_suite/preloader)){
+atom/New(atom/loc, dmm_suite/preloader/_dmm_preloader)
+ if(istype(_dmm_preloader, /dmm_suite/preloader))
_dmm_preloader.load(src)
- }
. = ..()
- }
-dmm_suite{
- preloader{
- parent_type = /datum
- var{
- list/attributes
- }
- New(list/the_attributes){
- .=..()
- if(!the_attributes.len){ Del()}
- attributes = the_attributes
- }
- proc{
- load(atom/what){
- for(var/attribute in attributes){
- what.vars[attribute] = attributes[attribute]
- }
- Del()
- }
- }
- }
- }
+
+dmm_suite
+ preloader
+ parent_type = /datum
+ var
+ list/attributes
+ New(list/the_attributes)
+ .=..()
+ if(!the_attributes.len)
+ Del()
+ attributes = the_attributes
+ proc
+ load(atom/what)
+ for(var/attribute in attributes)
+ what.vars[attribute] = attributes[attribute]
+ Del()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
index b0222d60c9e..cfb3606eb90 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
@@ -167,20 +167,15 @@
if ((O.client && !( O.blinded )))
O << "\red [src] spits neurotoxin at [target]!"
//I'm not motivated enough to revise this. Prjectile code in general needs update.
- var/turf/T = loc
- var/turf/U = (istype(target, /atom/movable) ? target.loc : target)
+ var/turf/T = get_turf(src)
+ var/turf/U = (istype(target, /atom/movable) ? get_turf(target) : target)
- if(!U || !T)
- return
- while(U && !istype(U,/turf))
- U = U.loc
- if(!istype(T, /turf))
+ if(!istype(T, /turf) || !istype(U,/turf))
return
+
if (U == T)
usr.bullet_act(src, src.get_organ_target())
return
- if(!istype(U, /turf))
- return
var/obj/item/projectile/energy/dart/A = new /obj/item/projectile/energy/dart(usr.loc)
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index b160bf1e985..132c1bc2822 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -88,7 +88,7 @@
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
if(mind)
mind.store_memory("Time of death: [tod]", 0)
- sql_report_death(src)
+// sql_report_death(src)
//Calls the rounds wincheck, mainly for wizard, malf, and changeling now
ticker.mode.check_win()
diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm
index fefedcfe593..a128f7a899c 100644
--- a/code/modules/mob/living/silicon/robot/death.dm
+++ b/code/modules/mob/living/silicon/robot/death.dm
@@ -67,7 +67,7 @@
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
store_memory("Time of death: [tod]", 0)
- sql_report_cyborg_death(src)
+// sql_report_cyborg_death(src)
if (src.key)
spawn(50)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 62f05de514e..aabe19c9e90 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -1081,7 +1081,7 @@ note dizziness decrements automatically in the mob's Life() proc.
* Sends resource files to client cache
*/
/mob/proc/getFiles()
- if(!isemptylist(args))
+ if(args && args.len)
for(var/file in args)
src << browse_rsc(file)
return 1
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 8c1c43e6a9c..ed25c5c204b 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -57,7 +57,7 @@
if(M)
M.NotTargeted(src)
del(target)
- usr.visible_message("\blue [usr] lowers \the [src]...")
+ usr.visible_message("\blue \The [usr] lowers \the [src]...")
return 0
return 1
@@ -65,36 +65,36 @@
attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (M == user && user.zone_sel.selecting == "mouth" && load_into_chamber() && !mouthshoot) //Suicide handling.
mouthshoot = 1
- M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...")
+ M.visible_message("\red \The [user] sticks their gun in their mouth, ready to pull the trigger...")
if(!do_after(user, 40))
- M.visible_message("\blue [user] decided life was worth living")
+ M.visible_message("\blue \The [user] decided life was worth living")
mouthshoot = 0
return
if(istype(src.in_chamber, /obj/item/projectile/bullet) && !istype(src.in_chamber, /obj/item/projectile/bullet/stunshot) && !istype(src.in_chamber, /obj/item/ammo_casing/shotgun/beanbag))
M.apply_damage(75, BRUTE, "head", used_weapon = "Suicide attempt with a projectile weapon.")
M.apply_damage(85, BRUTE, "chest")
- M.visible_message("\red [user] pulls the trigger.")
+ M.visible_message("\red \The [user] pulls the trigger.")
else if(istype(src.in_chamber, /obj/item/projectile/bullet/stunshot) || istype(src.in_chamber, /obj/item/projectile/energy/electrode))
M.apply_damage(10, BURN, "head", used_weapon = "Suicide attempt with a stun round.")
- M.visible_message("\red [user] pulls the trigger, but luckily it was a stun round.")
+ M.visible_message("\red \The [user] pulls the trigger, but luckily it was a stun round.")
else if(istype(src.in_chamber, /obj/item/ammo_casing/shotgun/beanbag))
M.apply_damage(20, BRUTE, "head", used_weapon = "Suicide attempt with a beanbag.")
- M.visible_message("\red [user] pulls the trigger, but luckily it was a stun round.")
+ M.visible_message("\red \The [user] pulls the trigger, but luckily it was a stun round.")
else if(istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy))
M.apply_damage(75, BURN, "head", used_weapon = "Suicide attempt with an energy weapon")
M.apply_damage(85, BURN, "chest")
- M.visible_message("\red [user] pulls the trigger.")
+ M.visible_message("\red \The [user] pulls the trigger.")
else
M.apply_damage(75, BRUTE, "head", used_weapon = "Suicide attempt with a gun")
M.apply_damage(85, BRUTE, "chest")
- M.visible_message("\red [user] pulls the trigger. Ow.")
+ M.visible_message("\red \The [user] pulls the trigger. Ow.")
del(in_chamber)
mouthshoot = 0
return
else if(user.a_intent == "hurt" && load_into_chamber() && (istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy)\
|| istype(src.in_chamber, /obj/item/projectile/bullet)) && !istype(in_chamber,/obj/item/projectile/energy/electrode)) //Point blank shooting.
//Lets shoot them, then.
- user.visible_message("\red [user] fires \the [src] point blank at [M]!")
+ user.visible_message("\red \The [user] fires \the [src] point blank at [M]!")
if(silenced)
playsound(user, fire_sound, 10, 1)
else
@@ -109,7 +109,7 @@
return
else if(user.a_intent != "hurt" && load_into_chamber() && istype(in_chamber,/obj/item/projectile/energy/electrode)) //Point blank tasering.
if (M.canstun == 0 || M.canweaken == 0)
- user.visible_message("\red [M] has been stunned with the taser gun by [user] to no effect!")
+ user.visible_message("\red \The [M] has been stunned with the taser gun by \the [user] to no effect!")
del(in_chamber)
update_icon()
return
@@ -125,7 +125,7 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
- user.visible_message("\red [M] has been stunned with the taser gun by [user]!")
+ user.visible_message("\red \The [M] has been stunned with the taser gun by \the [user]!")
M.attack_log += text("\[[]\] []/[] stunned []/[] with a []", time_stamp(), user, user.ckey, M, M.ckey, src)
user.attack_log += text("\[[]\] []/[] stunned []/[] with a []", time_stamp(), user, user.ckey, M, M.ckey, src)
log_admin("ATTACK: [user] ([user.ckey]) stunned [M] ([M.ckey]) with [src].")
@@ -144,7 +144,7 @@
//POWPOW!... Used to be afterattack.
- proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params)//TODO: go over this
+ proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this
if(istype(user, /mob/living))
var/mob/living/M = user
if ((CLUMSY in M.mutations) && prob(50)) ///Who ever came up with this...
@@ -193,7 +193,10 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
- user.visible_message("\red [user] fires \the [src]!", "\red You fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
+ if(reflex)
+ user.visible_message("\red \The [user] fires \the [src] by reflex!", "\red You reflex fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
+ else
+ user.visible_message("\red \The [user] fires \the [src]!", "\red You fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
in_chamber.original = targloc
in_chamber.loc = get_turf(user)
@@ -254,7 +257,7 @@
var/firing_check = in_chamber.check_fire(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
if(firing_check == 1)
- Fire(T,usr)
+ Fire(T,usr, reflex = 1)
else if(!told_cant_shoot)
M << "\red They can't be hit from here!"
told_cant_shoot = 1