Improved to_chat debug message (#4795)

Also fixed a couple related, minor bugs
This commit is contained in:
Krausus
2016-06-28 11:34:54 -04:00
committed by Fox McCloud
parent 57c7a78e9d
commit 8d7e638f6e
4 changed files with 17 additions and 6 deletions
+3
View File
@@ -20,3 +20,6 @@ This may require updating to a beta release.
#endif
var/global/list/processing_objects = list() //This has to be initialized BEFORE world
// Macros that must exist before world.dm
#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat
+3 -1
View File
@@ -402,7 +402,9 @@ var/bomb_set
/obj/item/weapon/disk/nuclear/process()
var/turf/disk_loc = get_turf(src)
if(disk_loc.z != ZLEVEL_STATION && disk_loc.z != ZLEVEL_CENTCOMM)
to_chat(get(src, /mob), "<span class='danger'>You can't help but feel that you just lost something back there...</span>")
var/holder = get(src, /mob)
if(holder)
to_chat(holder, "<span class='danger'>You can't help but feel that you just lost something back there...</span>")
qdel(src)
/obj/item/weapon/disk/nuclear/Destroy()
+3 -2
View File
@@ -531,11 +531,12 @@ obj/item/toy/cards/deck/MouseDrop(atom/over_object)
if(!remove_item_from_storage(M))
M.unEquip(src)
M.put_in_l_hand(src)
else if("r_hand")
to_chat(usr, "<span class='notice'>You pick up the deck.</span>")
if("r_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
M.put_in_r_hand(src)
to_chat(usr, "<span class='notice'>You pick up the deck.</span>")
to_chat(usr, "<span class='notice'>You pick up the deck.</span>")
else
to_chat(usr, "<span class='notice'>You can't reach it from here.</span>")
+8 -3
View File
@@ -197,11 +197,16 @@ var/list/chatResources = list(
/proc/bi(obj)
bicon(obj)
/proc/to_chat(target, message)
var/to_chat_filename
var/to_chat_line
var/to_chat_src
// Call using macro: to_chat(target, message)
/proc/__to_chat(target, message)
if(istype(message, /image) || istype(message, /sound) || istype(target, /savefile) || !(ismob(target) || islist(target) || isclient(target) || target == world))
target << message
if (!isatom(target)) // Really easy to mix these up, and not having to make sure things are mobs makes the code cleaner.
CRASH("DEBUG: to_chat called with invalid message")
if(!istext(message))
message = "(non-text type)"
world.Error(new/exception("DEBUG: to_chat called with invalid message: [message]", to_chat_filename, to_chat_line), e_src = to_chat_src)
return
else if(istext(message))