Skip to content

Commit

Permalink
Merge pull request #4158 from out-of-phaze/codequality/mob-living-H
Browse files Browse the repository at this point in the history
Replace a bunch of single- and double-letter variable names with more descriptive terms
  • Loading branch information
MistakeNot4892 committed Jul 7, 2024
2 parents 069cc01 + a174990 commit 3fce4eb
Show file tree
Hide file tree
Showing 17 changed files with 693 additions and 706 deletions.
1 change: 1 addition & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
#define SPAN_PINK(X) SPAN_CLASS("font_pink", X)
#define SPAN_PALEPINK(X) SPAN_CLASS("font_palepink", X)
#define SPAN_SINISTER(X) SPAN_CLASS("sinister", X)
#define SPAN_MODERATE(X) SPAN_CLASS("moderate", X)
// placeholders
#define SPAN_GOOD(X) SPAN_GREEN(X)
#define SPAN_NEUTRAL(X) SPAN_BLUE(X)
Expand Down
3 changes: 1 addition & 2 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
// Receive a mouse drop.
// Returns false if the atom is valid for dropping further up the chain, true if the drop has been handled.
/atom/proc/receive_mouse_drop(atom/dropping, mob/user, params)
var/mob/living/H = user
if(istype(H) && !H.anchored && can_climb(H) && dropping == user)
if(isliving(user) && !user.anchored && can_climb(user) && dropping == user)
do_climb(dropping)
return TRUE
return FALSE
8 changes: 4 additions & 4 deletions code/datums/hostility/hostility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
return FALSE

if(isliving(target))
var/mob/living/L = target
if(L.stat)
var/mob/living/target_mob = target
if(target_mob.stat)
return FALSE

if(isliving(holder))
var/mob/living/H = holder
if(L.faction == H.faction)
var/mob/holder_mob = holder
if(target_mob.faction == holder_mob.faction)
return FALSE

return can_special_target(holder, target)
Expand Down
18 changes: 9 additions & 9 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -961,24 +961,24 @@ var/global/BSACooldown = 0
/proc/is_special_character(var/character) // returns 1 for special characters and 2 for heroes of gamemode
if(!SSticker.mode)
return 0
var/datum/mind/M
var/datum/mind/mind
if (ismob(character))
var/mob/C = character
M = C.mind
var/mob/character_mob = character
mind = character_mob.mind
else if(istype(character, /datum/mind))
M = character
mind = character

if(M)
if(mind)
if(SSticker.mode.antag_templates && SSticker.mode.antag_templates.len)
for(var/decl/special_role/antag in SSticker.mode.antag_templates)
if(antag.is_antagonist(M))
if(antag.is_antagonist(mind))
return 2
if(M.assigned_special_role)
if(mind.assigned_special_role)
return 1

if(isrobot(character))
var/mob/living/silicon/robot/R = character
if(R.emagged)
var/mob/living/silicon/robot/robot = character
if(robot.emagged)
return 1

return 0
Expand Down
Loading

0 comments on commit 3fce4eb

Please sign in to comment.