Allow ghosts to use any NanoUI interface.

This commit is contained in:
Bjorn Neergaard
2015-11-30 23:34:59 -05:00
parent 2713ceb0d5
commit 6f098e8298
5 changed files with 16 additions and 4 deletions
+7
View File
@@ -67,6 +67,13 @@
return NANO_DISABLED
return ..()
/mob/dead/observer/shared_nano_interaction(atom/movable/src_object)
if (check_rights(R_ADMIN, 0, src))
return NANO_INTERACTIVE // Admins can interact anyway.
if(!client || get_dist(src_object, src) > client.view)
return NANO_CLOSE // Keep ghosts from opening too many NanoUIs.
return NANO_UPDATE // Ghosts can only view.
/**
* public
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* NanoUI State: contained_state
*
* Checks that the user is an admin, end-of-story.
* Checks that the user is inside the src_object.
**/
/var/global/datum/topic_state/contained_state/contained_state = new()
+1 -3
View File
@@ -13,9 +13,7 @@
return NANO_CLOSE // Don't allow interaction by default.
/mob/dead/observer/default_can_use_topic(atom/movable/src_object)
if (check_rights(R_ADMIN, 0, src))
return NANO_INTERACTIVE // Admins can interact anyway.
return NANO_UPDATE // Ghosts can only view.
return shared_nano_interaction(src_object)
/mob/living/default_can_use_topic(atom/movable/src_object)
. = shared_nano_interaction(src_object)
+3
View File
@@ -14,6 +14,9 @@
/mob/proc/notcontained_can_use_topic(atom/movable/src_object)
return NANO_CLOSE
/mob/dead/observer/notcontained_can_use_topic(atom/movable/src_object)
return default_can_use_topic(src_object)
/mob/living/notcontained_can_use_topic(atom/movable/src_object)
if (src_object.contains(src))
return NANO_CLOSE // Close if we're inside it.