diff --git a/code/__HELPERS/admin.dm b/code/__HELPERS/admin.dm
new file mode 100644
index 0000000000..63df20ce46
--- /dev/null
+++ b/code/__HELPERS/admin.dm
@@ -0,0 +1,9 @@
+/// Returns if the given client is an admin, REGARDLESS of if they're deadminned or not.
+/proc/is_admin(client/client)
+ return !isnull(GLOB.admin_datums[client.ckey]) || !isnull(GLOB.deadmins[client.ckey])
+
+/// Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc.
+/proc/alert_to_permissions_elevation_attempt(mob/user)
+ var/message = " has tried to elevate permissions!"
+ message_admins(key_name_admin(user) + message)
+ log_admin(key_name(user) + message)
diff --git a/code/datums/action.dm b/code/datums/action.dm
index 77d6b78917..a4bd371c1e 100644
--- a/code/datums/action.dm
+++ b/code/datums/action.dm
@@ -93,7 +93,7 @@
if(!hud.mymob)
continue
HideFrom(hud.mymob)
- LAZYREMOVE(remove_from.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared
+ LAZYREMOVE(remove_from?.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared
viewers = list()
if(isnull(owner))
diff --git a/code/datums/components/rotation.dm b/code/datums/components/rotation.dm
index 8eb37eabdf..043e2f8f18 100644
--- a/code/datums/components/rotation.dm
+++ b/code/datums/components/rotation.dm
@@ -13,7 +13,7 @@
var/rotation_flags = NONE
var/default_rotation_direction = ROTATION_CLOCKWISE
-/datum/component/simple_rotation/Initialize(rotation_flags = NONE ,can_user_rotate,can_be_rotated,after_rotation)
+/datum/component/simple_rotation/Initialize(rotation_flags = NONE, can_user_rotate, can_be_rotated, after_rotation)
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 0eaba60ba8..6c1b085e0c 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -702,7 +702,8 @@
/atom/proc/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
SEND_SIGNAL(src, COMSIG_ATOM_HITBY, hitting_atom, skipcatch, hitpush, blocked, throwingdatum)
if(density && !has_gravity(hitting_atom)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...).
- addtimer(CALLBACK(src, PROC_REF(hitby_react), hitting_atom), 2)
+ addtimer(CALLBACK(src, PROC_REF(hitby_react), hitting_atom), 0.2 SECONDS)
+ return FALSE
/**
* We have have actually hit the passed in atom
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index df751a114a..7d1bda4340 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -389,7 +389,7 @@
/atom/movable/hitby(atom/movable/hitting_atom, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum)
if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO))))
step(src, hitting_atom.dir)
- ..()
+ return ..()
/atom/movable/proc/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE)
if((force < (move_resist * MOVE_FORCE_THROW_RATIO)) || (move_resist == INFINITY))
diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm
index 831041db91..a14d207423 100644
--- a/code/game/objects/obj_defense.dm
+++ b/code/game/objects/obj_defense.dm
@@ -47,14 +47,14 @@
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
-/obj/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
+/obj/hitby(atom/movable/hit_by, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..()
- var/throwdamage = AM.throwforce
- if(isobj(AM))
- var/obj/O = AM
- if(O.damtype == STAMINA)
+ var/throwdamage = hit_by.throwforce
+ if(isobj(hit_by))
+ var/obj/as_obj = hit_by
+ if(as_obj.damtype == STAMINA)
throwdamage = 0
- take_damage(throwdamage, BRUTE, MELEE, 1, get_dir(src, AM))
+ take_damage(throwdamage, BRUTE, MELEE, 1, get_dir(src, hit_by))
/obj/ex_act(severity, target, origin)
if(resistance_flags & INDESTRUCTIBLE)
diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm
index ba854e7ec2..f0cb2c22d0 100644
--- a/code/game/objects/structures/beds_chairs/chair.dm
+++ b/code/game/objects/structures/beds_chairs/chair.dm
@@ -17,9 +17,9 @@
/obj/structure/chair/examine(mob/user)
. = ..()
- . += "It's held together by a couple of bolts."
+ . += span_notice("It's held together by a couple of bolts.")
if(!has_buckled_mobs())
- . += "Drag your sprite to sit in it."
+ . += span_notice("Drag your sprite to sit in it.")
/obj/structure/chair/Initialize(mapload)
. = ..()
@@ -28,7 +28,7 @@
/obj/structure/chair/ComponentInitialize()
. = ..()
- AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, PROC_REF(can_user_rotate),CALLBACK(src), PROC_REF(can_be_rotated)),null)
+ AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE, CALLBACK(src, PROC_REF(can_user_rotate)), CALLBACK(src, PROC_REF(can_be_rotated)), null)
/obj/structure/chair/proc/can_be_rotated(mob/user)
return TRUE
diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm
index 79ba4abae7..08cfbe3218 100644
--- a/code/modules/admin/admin_ranks.dm
+++ b/code/modules/admin/admin_ranks.dm
@@ -13,9 +13,7 @@ GLOBAL_PROTECT(protected_ranks)
/datum/admin_rank/New(init_name, init_rights, init_exclude_rights, init_edit_rights)
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
if (name == "NoRank") //only del if this is a true creation (and not just a New() proc call), other wise trialmins/coders could abuse this to deadmin other admins
QDEL_IN(src, 0)
CRASH("Admin proc call creation of admin datum")
@@ -35,9 +33,7 @@ GLOBAL_PROTECT(protected_ranks)
/datum/admin_rank/Destroy()
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return QDEL_HINT_LETMELIVE
. = ..()
@@ -93,9 +89,7 @@ GLOBAL_PROTECT(protected_ranks)
// Adds/removes rights to this admin_rank
/datum/admin_rank/proc/process_keyword(word, previous_rights=0)
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return
var/flag = admin_keyword_to_flag(word, previous_rights)
if(flag)
diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm
index ea16283070..2bd6dc9236 100644
--- a/code/modules/admin/holder2.dm
+++ b/code/modules/admin/holder2.dm
@@ -40,9 +40,7 @@ GLOBAL_PROTECT(href_token)
/datum/admins/New(datum/admin_rank/R, ckey, force_active = FALSE, protected)
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
if (!target) //only del if this is a true creation (and not just a New() proc call), other wise trialmins/coders could abuse this to deadmin other admins
QDEL_IN(src, 0)
CRASH("Admin proc call creation of admin datum")
@@ -70,17 +68,13 @@ GLOBAL_PROTECT(href_token)
/datum/admins/Destroy()
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return QDEL_HINT_LETMELIVE
. = ..()
/datum/admins/proc/activate()
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return
GLOB.deadmins -= target
GLOB.admin_datums[target] = src
@@ -91,9 +85,7 @@ GLOBAL_PROTECT(href_token)
/datum/admins/proc/deactivate()
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return
GLOB.deadmins[target] = src
GLOB.admin_datums -= target
@@ -105,9 +97,7 @@ GLOBAL_PROTECT(href_token)
/datum/admins/proc/associate(client/C)
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return
if(istype(C))
@@ -127,9 +117,7 @@ GLOBAL_PROTECT(href_token)
/datum/admins/proc/disassociate()
if(IsAdminAdvancedProcCall())
- var/msg = " has tried to elevate permissions!"
- message_admins("[key_name_admin(usr)][msg]")
- log_admin("[key_name(usr)][msg]")
+ alert_to_permissions_elevation_attempt(usr)
return
if(owner)
GLOB.admins -= owner
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index 2e586228af..22b1c8fd6d 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -130,10 +130,10 @@
return FALSE
-/obj/item/assembly/mousetrap/hitby(atom/hit_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
+/obj/item/assembly/mousetrap/hitby(atom/movable/hit_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(!armed)
return ..()
- visible_message("[src] is triggered by [hit_atom].")
+ visible_message(span_warning("[src] is triggered by [hit_atom]."))
triggered(null)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index f38721671c..7e505d2861 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -1139,11 +1139,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(user.client)
if(unlock_content)
dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
"
- if(unlock_content || check_rights_for(user.client, R_ADMIN))
+ if(unlock_content || is_admin(user.client))
dat += "OOC Color: [ooccolor ? ooccolor : GLOB.normal_ooc_colour] Change
"
dat += "Antag OOC Color: [aooccolor ? aooccolor : GLOB.normal_aooc_colour] Change
"
- if(user.client.holder)
+ if(is_admin(user.client))
dat += "