diff --git a/code/game/objects/items/weapons/capture_crystal.dm b/code/game/objects/items/weapons/capture_crystal.dm
index 46b935419e..4cc748af13 100644
--- a/code/game/objects/items/weapons/capture_crystal.dm
+++ b/code/game/objects/items/weapons/capture_crystal.dm
@@ -81,7 +81,7 @@
else
to_chat(M, "\The [src] emits an unpleasant tone... \The [bound_mob] is unresponsive.")
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
-
+
//Lets the owner get AI controlled bound mobs to follow them, or tells player controlled mobs to follow them.
/obj/item/capture_crystal/verb/follow_owner()
set name = "Toggle Follow"
@@ -208,7 +208,7 @@
else return TRUE
/obj/item/capture_crystal/attack(mob/living/M, mob/living/user)
- if(bound_mob)
+ if(bound_mob)
if(!bound_mob.devourable) //Don't eat if prefs are bad
return
if(user.zone_sel.selecting == "mouth") //Click while targetting the mouth and you eat/feed the stored mob to whoever you clicked on
@@ -268,7 +268,7 @@
bound_mob.capture_caught = TRUE
persist_storable = FALSE
desc = "A glowing crystal in what appears to be some kind of steel housing."
-
+
//Determines the capture chance! So you can't capture AI mobs if they're perfectly healthy and all that
/obj/item/capture_crystal/proc/capture_chance(mob/living/M, user)
if(capture_chance_modifier >= 100) //Master crystal always work
@@ -435,7 +435,7 @@
/obj/item/capture_crystal/proc/recall(mob/living/user)
if(bound_mob in view(user)) //We can only recall it if we can see it
var/turf/turfmemory = get_turf(bound_mob)
- if(isanimal(bound_mob))
+ if(isanimal(bound_mob) && bound_mob.ai_holder)
var/mob/living/simple_mob/M = bound_mob
M.ai_holder.go_sleep() //AI doesn't need to think when it's in the crystal
bound_mob.forceMove(src)
diff --git a/code/modules/lore_codex/codex_tree.dm b/code/modules/lore_codex/codex_tree.dm
index 993a5f17d9..71aa80b087 100644
--- a/code/modules/lore_codex/codex_tree.dm
+++ b/code/modules/lore_codex/codex_tree.dm
@@ -46,7 +46,7 @@
// Returns to the last visited page, based on the history list.
/datum/codex_tree/proc/go_back()
- if(history.len - 1)
+ if((history.len - 1) > 0)
if(history[history.len] == current_page)
history.len-- // This gets rid of the current page in the history.
go_to_page(pop(history), dont_record_history = TRUE) // Where as this will get us the previous page that we want to go to.
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 10afe6b7d4..8d6de4cc0c 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -125,14 +125,14 @@
tie_msg += " [lowertext(english_list(accessory_descs))]."
if(w_uniform.blood_DNA)
- msg += "[T.He] [T.is] wearing [bicon(w_uniform)] [w_uniform.gender==PLURAL?"some":"a"] [(w_uniform.blood_color != "#030303") ? "blood" : "oil"]-stained [w_uniform.name]![tie_msg]"
+ msg += "[T.He] [T.is] wearing \icon[w_uniform][bicon(w_uniform)] [w_uniform.gender==PLURAL?"some":"a"] [(w_uniform.blood_color != "#030303") ? "blood" : "oil"]-stained [w_uniform.name]![tie_msg]"
else
msg += "[T.He] [T.is] wearing [bicon(w_uniform)] \a [w_uniform].[tie_msg]"
//head
if(head && !(skip_gear & EXAMINE_SKIPHELMET) && head.show_examine)
if(head.blood_DNA)
- msg += "[T.He] [T.is] wearing [bicon(head)] [head.gender==PLURAL?"some":"a"] [(head.blood_color != "#030303") ? "blood" : "oil"]-stained [head.name] on [T.his] head!"
+ msg += "[T.He] [T.is] wearing \icon[w_uniform][bicon(head)] [head.gender==PLURAL?"some":"a"] [(head.blood_color != "#030303") ? "blood" : "oil"]-stained [head.name] on [T.his] head!"
else
msg += "[T.He] [T.is] wearing [bicon(head)] \a [head] on [T.his] head."
@@ -151,44 +151,44 @@
tie_msg += " [lowertext(english_list(accessory_descs))]."
if(wear_suit.blood_DNA)
- msg += "[T.He] [T.is] wearing [bicon(wear_suit)] [wear_suit.gender==PLURAL?"some":"a"] [(wear_suit.blood_color != "#030303") ? "blood" : "oil"]-stained [wear_suit.name]![tie_msg]"
+ msg += "[T.He] [T.is] wearing \icon[wear_suit][bicon(wear_suit)] [wear_suit.gender==PLURAL?"some":"a"] [(wear_suit.blood_color != "#030303") ? "blood" : "oil"]-stained [wear_suit.name]![tie_msg]"
else
- msg += "[T.He] [T.is] wearing [bicon(wear_suit)] \a [wear_suit].[tie_msg]"
+ msg += "[T.He] [T.is] wearing \icon[wear_suit][bicon(wear_suit)] \a [wear_suit].[tie_msg]"
//suit/armour storage
if(s_store && !(skip_gear & EXAMINE_SKIPSUITSTORAGE) && s_store.show_examine)
if(s_store.blood_DNA)
- msg += "[T.He] [T.is] carrying [bicon(s_store)] [s_store.gender==PLURAL?"some":"a"] [(s_store.blood_color != "#030303") ? "blood" : "oil"]-stained [s_store.name] on [T.his] [wear_suit.name]!"
+ msg += "[T.He] [T.is] carrying \icon[s_store][bicon(s_store)] [s_store.gender==PLURAL?"some":"a"] [(s_store.blood_color != "#030303") ? "blood" : "oil"]-stained [s_store.name] on [T.his] [wear_suit.name]!"
else
- msg += "[T.He] [T.is] carrying [bicon(s_store)] \a [s_store] on [T.his] [wear_suit.name]."
+ msg += "[T.He] [T.is] carrying \icon[s_store][bicon(s_store)] \a [s_store] on [T.his] [wear_suit.name]."
//back
if(back && !(skip_gear & EXAMINE_SKIPBACKPACK) && back.show_examine)
if(back.blood_DNA)
- msg += "[T.He] [T.has] [bicon(back)] [back.gender==PLURAL?"some":"a"] [(back.blood_color != "#030303") ? "blood" : "oil"]-stained [back] on [T.his] back."
+ msg += "[T.He] [T.has] \icon[back][bicon(back)] [back.gender==PLURAL?"some":"a"] [(back.blood_color != "#030303") ? "blood" : "oil"]-stained [back] on [T.his] back."
else
- msg += "[T.He] [T.has] [bicon(back)] \a [back] on [T.his] back."
+ msg += "[T.He] [T.has] \icon[back][bicon(back)] \a [back] on [T.his] back."
//left hand
if(l_hand && l_hand.show_examine)
if(l_hand.blood_DNA)
- msg += "[T.He] [T.is] holding [bicon(l_hand)] [l_hand.gender==PLURAL?"some":"a"] [(l_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [l_hand.name] in [T.his] left hand!"
+ msg += "[T.He] [T.is] holding \icon[l_hand][bicon(l_hand)] [l_hand.gender==PLURAL?"some":"a"] [(l_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [l_hand.name] in [T.his] left hand!"
else
- msg += "[T.He] [T.is] holding [bicon(l_hand)] \a [l_hand] in [T.his] left hand."
+ msg += "[T.He] [T.is] holding \icon[l_hand][bicon(l_hand)] \a [l_hand] in [T.his] left hand."
//right hand
if(r_hand && r_hand.show_examine)
if(r_hand.blood_DNA)
- msg += "[T.He] [T.is] holding [bicon(r_hand)] [r_hand.gender==PLURAL?"some":"a"] [(r_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [r_hand.name] in [T.his] right hand!"
+ msg += "[T.He] [T.is] holding \icon[r_hand][bicon(r_hand)] [r_hand.gender==PLURAL?"some":"a"] [(r_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [r_hand.name] in [T.his] right hand!"
else
- msg += "[T.He] [T.is] holding [bicon(r_hand)] \a [r_hand] in [T.his] right hand."
+ msg += "[T.He] [T.is] holding \icon[r_hand][bicon(r_hand)] \a [r_hand] in [T.his] right hand."
//gloves
if(gloves && !(skip_gear & EXAMINE_SKIPGLOVES) && gloves.show_examine)
if(gloves.blood_DNA)
- msg += "[T.He] [T.has] [bicon(gloves)] [gloves.gender==PLURAL?"some":"a"] [(gloves.blood_color != "#030303") ? "blood" : "oil"]-stained [gloves.name] on [T.his] hands!"
+ msg += "[T.He] [T.has] \icon[gloves][bicon(gloves)] [gloves.gender==PLURAL?"some":"a"] [(gloves.blood_color != "#030303") ? "blood" : "oil"]-stained [gloves.name] on [T.his] hands!"
else
- msg += "[T.He] [T.has] [bicon(gloves)] \a [gloves] on [T.his] hands."
+ msg += "[T.He] [T.has] \icon[gloves][bicon(gloves)] \a [gloves] on [T.his] hands."
else if(blood_DNA && !(skip_body & EXAMINE_SKIPHANDS))
msg += "[T.He] [T.has] [(hand_blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained hands!"
@@ -206,16 +206,16 @@
//belt
if(belt && !(skip_gear & EXAMINE_SKIPBELT) && belt.show_examine)
if(belt.blood_DNA)
- msg += "[T.He] [T.has] [bicon(belt)] [belt.gender==PLURAL?"some":"a"] [(belt.blood_color != "#030303") ? "blood" : "oil"]-stained [belt.name] about [T.his] waist!"
+ msg += "[T.He] [T.has] \icon[belt][bicon(belt)] [belt.gender==PLURAL?"some":"a"] [(belt.blood_color != "#030303") ? "blood" : "oil"]-stained [belt.name] about [T.his] waist!"
else
- msg += "[T.He] [T.has] [bicon(belt)] \a [belt] about [T.his] waist."
+ msg += "[T.He] [T.has] \icon[belt][bicon(belt)] \a [belt] about [T.his] waist."
//shoes
if(shoes && !(skip_gear & EXAMINE_SKIPSHOES) && shoes.show_examine)
if(shoes.blood_DNA)
- msg += "[T.He] [T.is] wearing [bicon(shoes)] [shoes.gender==PLURAL?"some":"a"] [(shoes.blood_color != "#030303") ? "blood" : "oil"]-stained [shoes.name] on [T.his] feet!"
+ msg += "[T.He] [T.is] wearing \icon[shoes][bicon(shoes)] [shoes.gender==PLURAL?"some":"a"] [(shoes.blood_color != "#030303") ? "blood" : "oil"]-stained [shoes.name] on [T.his] feet!"
else
- msg += "[T.He] [T.is] wearing [bicon(shoes)] \a [shoes] on [T.his] feet."
+ msg += "[T.He] [T.is] wearing \icon[shoes][bicon(shoes)] \a [shoes] on [T.his] feet."
else if(feet_blood_DNA && !(skip_body & EXAMINE_SKIPHANDS))
msg += "[T.He] [T.has] [(feet_blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained feet!"
@@ -226,28 +226,28 @@
descriptor = "in [T.his] mouth"
if(wear_mask.blood_DNA)
- msg += "[T.He] [T.has] [bicon(wear_mask)] [wear_mask.gender==PLURAL?"some":"a"] [(wear_mask.blood_color != "#030303") ? "blood" : "oil"]-stained [wear_mask.name] [descriptor]!"
+ msg += "[T.He] [T.has] \icon[wear_mask][bicon(wear_mask)] [wear_mask.gender==PLURAL?"some":"a"] [(wear_mask.blood_color != "#030303") ? "blood" : "oil"]-stained [wear_mask.name] [descriptor]!"
else
- msg += "[T.He] [T.has] [bicon(wear_mask)] \a [wear_mask] [descriptor]."
+ msg += "[T.He] [T.has] \icon[wear_mask][bicon(wear_mask)] \a [wear_mask] [descriptor]."
//eyes
if(glasses && !(skip_gear & EXAMINE_SKIPEYEWEAR) && glasses.show_examine)
if(glasses.blood_DNA)
- msg += "[T.He] [T.has] [bicon(glasses)] [glasses.gender==PLURAL?"some":"a"] [(glasses.blood_color != "#030303") ? "blood" : "oil"]-stained [glasses] covering [T.his] eyes!"
+ msg += "[T.He] [T.has] \icon[glasses][bicon(glasses)] [glasses.gender==PLURAL?"some":"a"] [(glasses.blood_color != "#030303") ? "blood" : "oil"]-stained [glasses] covering [T.his] eyes!"
else
- msg += "[T.He] [T.has] [bicon(glasses)] \a [glasses] covering [T.his] eyes."
+ msg += "[T.He] [T.has] \icon[glasses][bicon(glasses)] \a [glasses] covering [T.his] eyes."
//left ear
if(l_ear && !(skip_gear & EXAMINE_SKIPEARS) && l_ear.show_examine)
- msg += "[T.He] [T.has] [bicon(l_ear)] \a [l_ear] on [T.his] left ear."
+ msg += "[T.He] [T.has] \icon[l_ear][bicon(l_ear)] \a [l_ear] on [T.his] left ear."
//right ear
if(r_ear && !(skip_gear & EXAMINE_SKIPEARS) && r_ear.show_examine)
- msg += "[T.He] [T.has] [bicon(r_ear)] \a [r_ear] on [T.his] right ear."
+ msg += "[T.He] [T.has] \icon[r_ear][bicon(r_ear)] \a [r_ear] on [T.his] right ear."
//ID
if(wear_id && wear_id.show_examine)
- msg += "[T.He] [T.is] wearing [bicon(wear_id)]\a [wear_id]."
+ msg += "[T.He] [T.is] wearing \icon[wear_id][bicon(wear_id)]\a [wear_id]."
//Jitters
if(is_jittery)
diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm
index b4aedf77a4..cfe88b60f2 100644
--- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/subtypes.dm
@@ -351,13 +351,13 @@
if(valid_turf)
valid_turfs.Add(potential_turf)
- var/turf/T = get_turf(src)
- var/turf/target_turf = pick(valid_turfs)
-
- if(!target_turf)
+ if(!(valid_turfs.len))
to_chat(src, span("warning", "There wasn't an unoccupied spot to teleport to."))
return FALSE
+ var/turf/target_turf = pick(valid_turfs)
+ var/turf/T = get_turf(src)
+
var/datum/effect/effect/system/spark_spread/s1 = new /datum/effect/effect/system/spark_spread
s1.set_up(5, 1, T)
var/datum/effect/effect/system/spark_spread/s2 = new /datum/effect/effect/system/spark_spread