diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm
index 4717be4f..65767a3d 100644
--- a/code/datums/brain_damage/imaginary_friend.dm
+++ b/code/datums/brain_damage/imaginary_friend.dm
@@ -77,7 +77,9 @@
var/datum/action/innate/imaginary_hide/hide
/mob/camera/imaginary_friend/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
greet()
Show()
diff --git a/code/datums/brain_damage/split_personality.dm b/code/datums/brain_damage/split_personality.dm
index 86d60177..6480974c 100644
--- a/code/datums/brain_damage/split_personality.dm
+++ b/code/datums/brain_damage/split_personality.dm
@@ -138,7 +138,9 @@
..()
/mob/living/split_personality/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, "As a split personality, you cannot do anything but observe. However, you will eventually gain control of your body, switching places with the current personality.")
to_chat(src, "Do not commit suicide or put the body in a deadly position. Behave like you care about it as much as the owner.")
@@ -214,7 +216,9 @@
var/codeword
/mob/living/split_personality/traitor/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, "As a brainwashed personality, you cannot do anything yet but observe. However, you may gain control of your body if you hear the special codeword, switching places with the current personality.")
to_chat(src, "Your activation codeword is: [codeword]")
if(objective)
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index f6ce9a6a..5a8222d6 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -68,6 +68,8 @@
var/list/learned_recipes //List of learned recipe TYPES.
+ var/reEnterCooldown = 0 //This was created to prevent players from deleting their own bodies when the server can't keep up with them and they're trying to re-enter/exit their corpse too quickly.
+
/datum/mind/New(var/key)
src.key = key
soulOwner = src
diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm
index 8bcf019a..0c83826a 100644
--- a/code/modules/antagonists/blob/blob/overmind.dm
+++ b/code/modules/antagonists/blob/blob/overmind.dm
@@ -163,7 +163,9 @@ GLOBAL_LIST_EMPTY(blob_nodes)
return ..()
/mob/camera/blob/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, "You are the overmind!")
blob_help()
update_health_hud()
diff --git a/code/modules/antagonists/clockcult/clock_mobs.dm b/code/modules/antagonists/clockcult/clock_mobs.dm
index 9bdf03cb..46d4cc51 100644
--- a/code/modules/antagonists/clockcult/clock_mobs.dm
+++ b/code/modules/antagonists/clockcult/clock_mobs.dm
@@ -28,7 +28,9 @@
update_values()
/mob/living/simple_animal/hostile/clockwork/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
add_servant_of_ratvar(src, TRUE)
to_chat(src, playstyle_string)
if(GLOB.ratvar_approaches)
diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
index e4722dbc..905f6034 100644
--- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
+++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
@@ -53,7 +53,9 @@
return TRUE
/mob/camera/eminence/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
add_servant_of_ratvar(src, TRUE)
var/datum/antagonist/clockcult/C = mind.has_antag_datum(/datum/antagonist/clockcult,TRUE)
if(C && C.clock_team)
diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm
index 2c968d4b..179989f2 100644
--- a/code/modules/antagonists/devil/true_devil/_true_devil.dm
+++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm
@@ -51,7 +51,9 @@
real_name = name
/mob/living/carbon/true_devil/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
var/datum/antagonist/devil/devilinfo = mind.has_antag_datum(/datum/antagonist/devil)
devilinfo.greet()
mind.announce_objectives()
diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm
index a9992d05..1ae02055 100644
--- a/code/modules/antagonists/disease/disease_mob.dm
+++ b/code/modules/antagonists/disease/disease_mob.dm
@@ -78,7 +78,9 @@ the new instance inside the host to be updated to the template's stats.
S.overmind = null
/mob/camera/disease/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
if(freemove)
to_chat(src, "You have [DisplayTimeText(freemove_end - world.time)] to select your first host. Click on a human to select your host.")
diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm
index a3bca403..7504adbb 100644
--- a/code/modules/antagonists/revenant/revenant.dm
+++ b/code/modules/antagonists/revenant/revenant.dm
@@ -86,7 +86,9 @@
name = built_name
/mob/living/simple_animal/revenant/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, "You are a revenant.")
to_chat(src, "Your formerly mundane spirit has been infused with alien energies and empowered into a revenant.")
to_chat(src, "You are not dead, not alive, but somewhere in between. You are capable of limited interaction with both worlds.")
diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm
index ad65bf8e..ccf9011a 100644
--- a/code/modules/mob/dead/dead.dm
+++ b/code/modules/mob/dead/dead.dm
@@ -116,6 +116,8 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/Login()
. = ..()
+ if(!. || !client)
+ return FALSE
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm
index c28e780a..acd96641 100644
--- a/code/modules/mob/dead/new_player/login.dm
+++ b/code/modules/mob/dead/new_player/login.dm
@@ -1,4 +1,6 @@
/mob/dead/new_player/Login()
+ if(!client)
+ return
if(CONFIG_GET(flag/use_exp_tracking))
client.set_exp_from_db()
client.set_db_player_flags()
@@ -7,7 +9,9 @@
mind.active = 1
mind.current = src
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
var/motd = global.config.motd
if(motd)
diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm
index 1b328dbc..39ebdb96 100644
--- a/code/modules/mob/dead/observer/login.dm
+++ b/code/modules/mob/dead/observer/login.dm
@@ -1,5 +1,7 @@
/mob/dead/observer/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 2c20a22f..b6cd8be8 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -360,6 +360,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(mind.current.key && mind.current.key[1] != "@") //makes sure we don't accidentally kick any clients
to_chat(usr, "Another consciousness is in your body...It is resisting you.")
return
+ if(mind.reEnterCooldown > world.time - 20) //cooldown to avoid body deletion. The server can be slower than players clicking this too fast.
+ to_chat(src, "You are doing this too fast. Stay still and try this again in a few seconds.")
+ return
+ mind.reEnterCooldown = world.time
client.change_view(CONFIG_GET(string/default_view))
SStgui.on_transfer(src, mind.current) // Transfer NanoUIs.
mind.current.key = key
diff --git a/code/modules/mob/living/carbon/alien/login.dm b/code/modules/mob/living/carbon/alien/login.dm
index 5c177fbb..c29cfb97 100644
--- a/code/modules/mob/living/carbon/alien/login.dm
+++ b/code/modules/mob/living/carbon/alien/login.dm
@@ -1,4 +1,6 @@
/mob/living/carbon/alien/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
AddInfectionImages()
return
diff --git a/code/modules/mob/living/carbon/human/login.dm b/code/modules/mob/living/carbon/human/login.dm
index 1ac24cff..ead82944 100644
--- a/code/modules/mob/living/carbon/human/login.dm
+++ b/code/modules/mob/living/carbon/human/login.dm
@@ -1,5 +1,7 @@
/mob/living/carbon/human/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
if(src.martial_art == default_martial_art && mind.stored_martial_art) //If the mind has a martial art stored and the body has the default one.
src.mind.stored_martial_art.teach(src) //Running teach so that it deals with help verbs.
else if(src.martial_art != default_martial_art && src.martial_art != mind.stored_martial_art) //If the body has a martial art which is not the default one and is not stored in the mind.
diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm
index f2e6fdce..77622e3c 100644
--- a/code/modules/mob/living/login.dm
+++ b/code/modules/mob/living/login.dm
@@ -1,5 +1,7 @@
/mob/living/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
//Mind updates
sync_mind()
mind.show_memory(src, 0)
diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm
index 98f38652..aff19f69 100644
--- a/code/modules/mob/living/silicon/ai/login.dm
+++ b/code/modules/mob/living/silicon/ai/login.dm
@@ -1,5 +1,7 @@
/mob/living/silicon/ai/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
if(stat != DEAD)
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
diff --git a/code/modules/mob/living/silicon/login.dm b/code/modules/mob/living/silicon/login.dm
index 2f133259..3b659ffd 100644
--- a/code/modules/mob/living/silicon/login.dm
+++ b/code/modules/mob/living/silicon/login.dm
@@ -7,4 +7,4 @@
var/datum/antagonist/bloodsucker/V = mind.has_antag_datum(/datum/antagonist/bloodsucker)
if(V)
mind.remove_antag_datum(V)
- ..()
+ return ..()
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index 05b0fc5e..8088fa72 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -163,14 +163,15 @@
return TRUE
/mob/living/silicon/pai/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
usr << browse_rsc('html/paigrid.png') // Go ahead and cache the interface resources as early as possible
- if(client)
- client.perspective = EYE_PERSPECTIVE
- if(holoform)
- client.eye = src
- else
- client.eye = card
+ client.perspective = EYE_PERSPECTIVE
+ if(holoform)
+ client.eye = src
+ else
+ client.eye = card
/mob/living/silicon/pai/get_status_tab_items()
. += ..()
diff --git a/code/modules/mob/living/silicon/robot/login.dm b/code/modules/mob/living/silicon/robot/login.dm
index 3856dd40..86c3f731 100644
--- a/code/modules/mob/living/silicon/robot/login.dm
+++ b/code/modules/mob/living/silicon/robot/login.dm
@@ -1,5 +1,7 @@
/mob/living/silicon/robot/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
regenerate_icons()
show_laws(0)
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index afc92c96..4ac89b09 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -957,6 +957,8 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/Login()
. = ..()
+ if(!. || !client)
+ return FALSE
access_card.access += player_access
diag_hud_set_botmode()
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index c3a6e257..4fc76910 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -64,7 +64,9 @@
CR.button.moved = "6:[pos],4:-2"
/mob/living/simple_animal/hostile/construct/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, playstyle_string)
/mob/living/simple_animal/hostile/construct/examine(mob/user)
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
index 9ca19132..1116acbf 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
@@ -130,7 +130,9 @@
return ..()
/mob/living/simple_animal/drone/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
check_laws()
if(flavortext)
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
index 521f458e..c108e727 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
@@ -37,7 +37,9 @@
hidden_uplink.telecrystals = 10
/mob/living/simple_animal/drone/syndrone/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
to_chat(src, "You can kill and eat other drones to increase your health!" )
/mob/living/simple_animal/drone/syndrone/badass
@@ -149,7 +151,9 @@
verbs -= /mob/living/simple_animal/drone/verb/drone_ping
/mob/living/simple_animal/drone/cogscarab/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
add_servant_of_ratvar(src, TRUE, GLOB.servants_active)
to_chat(src,"You yourself are one of these servants, and will be able to utilize almost anything they can[GLOB.ratvar_awakens ? "":", excluding a clockwork slab"].") // this can't go with flavortext because i'm assuming it requires them to be ratvar'd
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index fb61b593..ece357a2 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -70,7 +70,9 @@
humanize_spider(ghost)
/mob/living/simple_animal/hostile/poison/giant_spider/Login()
- ..()
+ . = ..()
+ if(!. || !client)
+ return FALSE
if(directive)
to_chat(src, "Your mother left you a directive! Follow it at all costs.")
to_chat(src, "[directive]")
@@ -490,6 +492,8 @@
/mob/living/simple_animal/hostile/poison/giant_spider/Login()
. = ..()
+ if(!. || !client)
+ return FALSE
GLOB.spidermobs[src] = TRUE
/mob/living/simple_animal/hostile/poison/giant_spider/Destroy()
diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm
index 04d27bb7..4a96c7ce 100644
--- a/code/modules/mob/login.dm
+++ b/code/modules/mob/login.dm
@@ -1,4 +1,6 @@
/mob/Login()
+ if(!client)
+ return FALSE
GLOB.player_list |= src
lastKnownIP = client.address
computer_id = client.computer_id
@@ -17,6 +19,9 @@
..()
+ if(!client)
+ return FALSE
+
reset_perspective(loc)
if(loc)
@@ -56,3 +61,4 @@
log_message("Client [key_name(src)] has taken ownership of mob [src]([src.type])", LOG_OWNERSHIP)
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)
+ return TRUE