From ebabf53c6d1d4963fecb7bddfcc8ce8b9863c108 Mon Sep 17 00:00:00 2001 From: ccomp5950 Date: Thu, 5 Mar 2015 10:44:14 -0500 Subject: [PATCH 1/4] Staff now have a "re-admin self" button after de-admining themselves. Stores their admin datum in a deadmin_holder variable in the client, and just moves it back upon re-admining. --- code/modules/admin/admin_verbs.dm | 12 ++++++++++++ code/modules/admin/holder2.dm | 14 +++++++++++--- code/modules/client/client defines.dm | 1 + 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d20105a67e..36d53e521b 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -662,6 +662,17 @@ var/list/admin_verbs_mentor = list( log_admin("[key_name(usr)] used 'kill air'.") message_admins("\blue [key_name_admin(usr)] used 'kill air'.", 1) +/client/proc/readmin_self() + set name = "Re-Admin self" + set category = "Admin" + + if(deadmin_holder) + deadmin_holder.reassociate() + log_admin("[src] re-admined themself.") + message_admins("[src] re-admined themself.", 1) + src << "You now have the keys to control the planet, or atleast a small space station" + verbs -= /client/proc/readmin_self + /client/proc/deadmin_self() set name = "De-admin self" set category = "Admin" @@ -672,6 +683,7 @@ var/list/admin_verbs_mentor = list( message_admins("[src] deadmined themself.", 1) deadmin() src << "You are now a normal player." + verbs |= /client/proc/readmin_self feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_log_hrefs() diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 34b4cacde9..ecfc952467 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -34,8 +34,16 @@ var/list/admin_datums = list() if(owner) admins -= owner owner.remove_admin_verbs() + owner.deadmin_holder = owner.holder owner.holder = null - owner = null + +/datum/admins/proc/reassociate() + if(owner) + admins += owner + owner.holder = src + owner.deadmin_holder = null + owner.add_admin_verbs() + /* checks if usr is an admin with at least ONE of the flags in rights_required. (Note, they don't need all the flags) @@ -50,6 +58,7 @@ proc/admin_proc() NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc which they did not call you will have to do something like if(client.holder.rights & R_ADMIN) yourself. */ + /proc/check_rights(rights_required, show_msg=1) if(usr && usr.client) if(rights_required) @@ -82,8 +91,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself. /client/proc/deadmin() - admin_datums -= ckey if(holder) holder.disassociate() - del(holder) + //del(holder) return 1 diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 81f53ec4d2..1155882b82 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -3,6 +3,7 @@ //ADMIN THINGS// //////////////// var/datum/admins/holder = null + var/datum/admins/deadmin_holder = null var/buildmode = 0 var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming. From bdd84767d129f52ca28925c825d6d103503e7f05 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Thu, 5 Mar 2015 22:28:22 +0100 Subject: [PATCH 2/4] AI can now track people holding up objects to the camera. --- code/game/machinery/camera/camera.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index d631ca46df..fbad7c7e92 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -166,7 +166,7 @@ for(var/mob/living/silicon/ai/O in living_mob_list) if(!O.client) continue if(U.name == "Unknown") O << "[U] holds \a [itemname] up to one of your cameras ..." - else O << "[U] holds \a [itemname] up to one of your cameras ..." + else O << "[U] holds \a [itemname] up to one of your cameras ..." O << browse(text("[][]", itemname, info), text("window=[]", itemname)) for(var/mob/O in player_list) if (istype(O.machine, /obj/machinery/computer/security)) From f064305a7b7c8d649aec8e3584ff58e52516835a Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 6 Mar 2015 07:11:19 +0300 Subject: [PATCH 3/4] Fixes #8268 --- code/modules/organs/blood.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 067ef6a42e..6e8f521e6d 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -97,7 +97,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 if(!pale) pale = 1 update_body() - eye_blurry += 6 + eye_blurry = max(eye_blurry,6) if(oxyloss < 50) oxyloss += 10 oxyloss += 1 @@ -329,4 +329,4 @@ proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large) if(source.data["virus2"]) B.virus2 = virus_copylist(source.data["virus2"]) - return B \ No newline at end of file + return B From 0262ab0de0e3a4a5e82d99a133190226788c4b77 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Fri, 6 Mar 2015 18:08:28 +0100 Subject: [PATCH 4/4] Runtime fixes Fixes ```` runtime error: Cannot read null.name proc name: sql report cyborg death (/proc/sql_report_cyborg_death) source file: statistics.dm,87 usr: the maintenance drone (106) (/mob/living/silicon/robot/drone) src: null ```` ```` runtime error: Cannot read null.name proc name: sql report death (/proc/sql_report_death) source file: statistics.dm,52 usr: null src: null ```` ```` runtime error: Cannot read null.armor proc name: infection check (/proc/infection_check) source file: helpers.dm,16 usr: null src: null ```` ```` runtime error: bad client proc name: open (/datum/nanoui/proc/open) source file: nanoui.dm,419 usr: null src: /datum/nanoui (/datum/nanoui) /datum/nanoui (/datum/nanoui): open() ```` ```` runtime error: undefined variable /obj/effect/plantsegment/var/movable proc name: update canmove (/mob/proc/update_canmove) source file: mob.dm,862 usr: null src: the monkey (643) (/mob/living/carbon/monkey) ```` --- code/defines/procs/statistics.dm | 10 ++++------ code/modules/events/event_manager.dm | 2 +- code/modules/mob/mob.dm | 4 +++- code/modules/nano/nanoui.dm | 2 ++ code/modules/virus2/helpers.dm | 23 ++++++++++++----------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 810bfb79aa..8a9eb4042d 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -47,9 +47,8 @@ proc/sql_report_death(var/mob/living/carbon/human/H) if(!H.key || !H.mind) return - var/turf/T = H.loc - var/area/placeofdeath = get_area(T.loc) - var/podname = placeofdeath.name + var/area/placeofdeath = get_area(H) + var/podname = placeofdeath ? placeofdeath.name : "Unknown area" var/sqlname = sanitizeSQL(H.real_name) var/sqlkey = sanitizeSQL(H.key) @@ -82,9 +81,8 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) if(!H.key || !H.mind) return - var/turf/T = H.loc - var/area/placeofdeath = get_area(T.loc) - var/podname = placeofdeath.name + var/area/placeofdeath = get_area(H) + var/podname = placeofdeath ? placeofdeath.name : "Unknown area" var/sqlname = sanitizeSQL(H.real_name) var/sqlkey = sanitizeSQL(H.key) diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index 070598b333..35b1d30d08 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -32,7 +32,7 @@ EC.process() /datum/event_manager/proc/event_complete(var/datum/event/E) - if(!E.event_meta) // datum/event is used here and there for random reasons, maintaining "backwards compatibility" + if(!E.event_meta || !E.severity) // datum/event is used here and there for random reasons, maintaining "backwards compatibility" log_debug("Event of '[E.type]' with missing meta-data has completed.") return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a93b000e0d..54987ff01d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -859,7 +859,9 @@ note dizziness decrements automatically in the mob's Life() proc. canmove = 1 pixel_y = V.mob_offset_y else if(buckled) - if (!buckled.movable) + // var/movable is defined at /obj/structure/stool/bed level + // If we're buckled to something else, such as vines, assume it's stationary. + if (!istype(buckled) || !buckled.movable) anchored = 1 canmove = 0 if(istype(buckled,/obj/structure/stool/bed/chair) ) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index bdfeffe58e..d269cb96fc 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -410,6 +410,8 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/open() + if(!user.client) + return var/window_size = "" if (width && height) diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 6f55e3ba58..17cabb5210 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -11,16 +11,17 @@ proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne") if(M.internal) score = 6 //not breathing infected air helps greatly var/obj/item/I = M.wear_mask - + //masks provide a small bonus and can replace overall bio protection - score = max(score, round(0.06*I.armor["bio"])) - if (istype(I, /obj/item/clothing/mask)) - score += 1 //this should be added after - + if(I) + score = max(score, round(0.06*I.armor["bio"])) + if (istype(I, /obj/item/clothing/mask)) + score += 1 //this should be added after + if("Contact") if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - + //gloves provide a larger bonus if (istype(H.gloves, /obj/item/clothing/gloves)) score += 2 @@ -45,12 +46,12 @@ proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne") return 0 var/protection = M.getarmor(null, "bio") //gets the full body bio armour value, weighted by body part coverage. - + if (vector == "Airborne") var/obj/item/I = M.wear_mask if (istype(I)) protection = max(protection, round(0.06*I.armor["bio"])) - + return prob(protection) //Checks if table-passing table can reach target (5 tile radius) @@ -80,10 +81,10 @@ proc/airborne_can_reach(turf/source, turf/target) return if(M.reagents.has_reagent("spaceacillin")) return - + if(!disease.affected_species.len) return - + if (!(M.species.name in disease.affected_species)) if (forced) disease.affected_species[1] = M.species.name @@ -131,7 +132,7 @@ proc/airborne_can_reach(turf/source, turf/target) // log_debug("Attempting virus [ID]") var/datum/disease2/disease/V = virus2[ID] if(V.spreadtype != vector) continue - + //It's hard to get other people sick if you're in an airtight suit. if(!infection_spreading_check(src, V.spreadtype)) continue