diff --git a/code/datums/helper_datums/global_iterator.dm b/code/datums/helper_datums/global_iterator.dm
index 08546a81ed4..ba23e19530c 100644
--- a/code/datums/helper_datums/global_iterator.dm
+++ b/code/datums/helper_datums/global_iterator.dm
@@ -58,6 +58,7 @@ Data storage vars:
var/state = 0
New(list/arguments=null,autostart=1)
+ delay = delay>0?(delay):1
if(forbid_garbage) //prevents garbage collection with tag != null
tag = "\ref[src]"
set_process_args(arguments)
@@ -73,13 +74,10 @@ Data storage vars:
src.stop()
return 0
result = src.process(arglist(arg_list))
- if(src.delay>0)
- for(var/sleep_time=src.delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
- if(!src.control_switch)
- return 0
- sleep(1)
- else
- sleep(src.delay) //delay can also be 0 and -1
+ for(var/sleep_time=src.delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
+ if(!src.control_switch)
+ return 0
+ sleep(1)
return 0
proc/start(list/arguments=null)
@@ -126,7 +124,7 @@ Data storage vars:
proc/set_delay(new_delay)
if(isnum(new_delay))
- delay = new_delay
+ delay = new_delay>0?(new_delay):1
return 1
else
return 0
diff --git a/code/game/asteroid/asteroid.dm b/code/game/asteroid/asteroid.dm
index 6e95a36df10..fa0704e9d54 100644
--- a/code/game/asteroid/asteroid.dm
+++ b/code/game/asteroid/asteroid.dm
@@ -1,8 +1,8 @@
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
- if(start_loc.x - size < 5 || start_loc.x + size >= world.maxx - 5 || start_loc.y - size < 5 || start_loc.y + size > world.maxy -5)
- return 0
if(!size)
size = pick(100;2,50;3,35;4,25;6,10;12)
+ if(start_loc.x - size < 5 || start_loc.x + size >= world.maxx - 5 || start_loc.y - size < 5 || start_loc.y + size > world.maxy -5)
+ return 0
if(!type)
type = pick(50;1,2,3)
if(!richness)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index bbc5f5e7fc4..0f44612b365 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -19,6 +19,14 @@
if(src.check_access(null))
if(density)
open()
+ else if(istype(AM, /obj/mecha))
+ var/obj/mecha/mecha = AM
+ if(density)
+ if(mecha.occupant && src.allowed(mecha.occupant))
+ open()
+ else
+ flick("door_deny", src)
+
/obj/machinery/door/proc/bumpopen(mob/user as mob)
if (src.operating)
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index e4a49c2f53e..156a5d78352 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -43,7 +43,8 @@
return
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
- return "* [src.name]"
+ if(!chassis) return
+ return "* [chassis.selected==src?"":""][src.name][chassis.selected==src?"":""]"
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
return range&RANGED
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index c287e1af7e4..86793f80350 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -71,8 +71,7 @@
/obj/beam/a_laser/pulse_laser/heavy_pulse
name = "heavy pulse laser"
- icon = 'xcomalien.dmi'
- icon_state = "plasma"
+ icon_state = "pulse1_bl"
life = 20
Bump(atom/A)
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index 93e26e95ce0..3e6ff9ce57f 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -246,14 +246,14 @@
return
proc/add_to_queue(part)
- if(!istype(queue, /list))
+ if(!istype(queue))
queue = list()
if(part)
queue[++queue.len] = part
return queue.len
proc/remove_from_queue(index)
- if(!isnum(index) || !istype(queue, /list) || (index<1 || index>queue.len))
+ if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len))
return 0
queue.Cut(index,++index)
return 1
@@ -277,13 +277,13 @@
proc/list_queue()
var/output = "Queue contains:"
- if(!istype(queue, /list) || !queue.len)
+ if(!istype(queue) || !queue.len)
output += "
Nothing"
else
output += "