Skip to content

Commit

Permalink
add: Z level checking optimization (#6240)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7e50571)
  • Loading branch information
Vladisvell committed Dec 9, 2024
1 parent 6b337dd commit 3b0f991
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions code/modules/space_management/zlevel_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new())


/datum/zlev_manager/proc/get_zlev(z)
if(!("[z]" in z_list))
log_runtime(EXCEPTION("Unmanaged z level: '[z]'"))
else
return z_list["[z]"]
return z_list["[z]"] == null ? log_runtime(EXCEPTION("Unmanaged z level: '[z]'")) : z_list["[z]"]

/datum/zlev_manager/proc/get_zlev_by_name(A)
if(!(A in levels_by_name))
log_runtime(EXCEPTION("Non-existent z level: '[A]'"))
return levels_by_name[A]
return levels_by_name[A] == null ? log_runtime(EXCEPTION("Non-existent z level: '[A]'")) : levels_by_name[A]

/*
* "Dirt" management
Expand Down

0 comments on commit 3b0f991

Please sign in to comment.