Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] isatom -> istom, add is_loc_predicate #3191

Open
wants to merge 1 commit into
base: dev-sierra
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions code/_helpers/functional.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
#undef PREPARE_ARGUMENTS
#undef PREPARE_INPUT

/proc/is_atom_predicate(value, feedback_receiver)
. = isatom(value)
/proc/is_loc_predicate(value, feedback_receiver)
. = isloc(value)
if(!. && feedback_receiver)
to_chat(feedback_receiver, SPAN_WARNING("Value must be an atom."))

/proc/is_tom_predicate(value, feedback_receiver)
. = istom(value)
if(!. && feedback_receiver)
to_chat(feedback_receiver, SPAN_WARNING("Value must be a turf or movable."))

/proc/is_num_predicate(value, feedback_receiver)
. = isnum(value)
if(!. && feedback_receiver)
Expand Down
2 changes: 1 addition & 1 deletion code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#define isairlock(A) istype(A, /obj/machinery/door/airlock)

#define isatom(A) (isloc(A) && !isarea(A))
#define istom(A) (isloc(A) && !isarea(A))

#define isprojectile(A) istype(A, /obj/item/projectile)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/audio/jukebox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/datum/jukebox/New(atom/_owner, _template, _ui_title, _ui_width, _ui_height)
. = ..()
if (QDELETED(_owner) || !isatom(_owner))
if (QDELETED(_owner) || !istom(_owner))
qdel(src)
return
owner = _owner
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/ammobox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
* Has no return value.
*/
/obj/item/ammobox/proc/set_ammo_type(obj/item/ammo_casing/new_ammo_type, casing_spent = FALSE)
if (isatom(new_ammo_type))
if (istom(new_ammo_type))
if (!istype(new_ammo_type))
return
casing_spent = !new_ammo_type.BB
Expand Down
5 changes: 5 additions & 0 deletions code/modules/admin/view_variables/vv_set_handlers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@

/singleton/vv_set_handler/ghost_appearance_handler
handled_type = /mob/observer/ghost
<<<<<<< ours
handled_vars = list("appearance" = TYPE_PROC_REF(/mob/observer/ghost, set_appearance))
predicates = list(GLOBAL_PROC_REF(is_atom_predicate))
=======
handled_vars = list("appearance" = /mob/observer/ghost/proc/set_appearance)
predicates = list(/proc/is_tom_predicate)
>>>>>>> theirs

/singleton/vv_set_handler/virtual_ability_handler
handled_type = /mob/observer/virtual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if(ispath(progress))
if(ispath(progress, object_path) || ispath(object_path, progress))
success = TRUE
else if(isatom(progress))
else if(istom(progress))
var/atom/A = progress
if(istype(A, object_path) || ispath(object_path, A.type))
success = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/psionics/faculties/energistics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if(istype(target))
target.electrocute_act(rand(15,45), user, 1, user.zone_sel.selecting)
return TRUE
else if(isatom(target))
else if(istom(target))
var/obj/item/cell/charging_cell = target.get_cell()
if(istype(charging_cell))
charging_cell.give(rand(15,45))
Expand Down
Loading