Dot Nonsense: find the current running proc's type!

This commit is contained in:
CitadelStationBot
2017-05-24 16:29:31 -05:00
parent 869953cd18
commit 62a7537030
2 changed files with 21 additions and 0 deletions
+13
View File
@@ -4,6 +4,19 @@
// #define EAST 4
// #define WEST 8
//These get to go at the top, because they're special
//You can use these defines to get the typepath of the currently running proc/verb (yes procs + verbs are objects)
/* eg:
/mob/living/carbon/human/death()
world << THIS_PROC_TYPE_STR //You can only output the string versions
Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a string with () (eg: the _WITH_ARGS defines) to make it look nicer)
*/
#define THIS_PROC_TYPE .....
#define THIS_PROC_TYPE_STR "[THIS_PROC_TYPE]" //Because you can only obtain a string of THIS_PROC_TYPE using "[]", and it's nice to just +/+= strings
#define THIS_PROC_TYPE_STR_WITH_ARGS "[THIS_PROC_TYPE]([args.Join(",")])"
#define THIS_PROC_TYPE_WEIRD ...... //This one is WEIRD, in some cases (When used in certain defines? (eg: ASSERT)) THIS_PROC_TYPE will fail to work, but THIS_PROC_TYPE_WEIRD will work instead
#define THIS_PROC_TYPE_WEIRD_STR "[THIS_PROC_TYPE_WEIRD]" //Included for completeness
#define THIS_PROC_TYPE_WEIRD_STR_WITH_ARGS "[THIS_PROC_TYPE_WEIRD]([args.Join(",")])" //Ditto
#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day
+8
View File
@@ -0,0 +1,8 @@
diff a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm (rejected hunks)
@@ -411,4 +424,4 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define GIBTONITE_UNSTRUCK 0
#define GIBTONITE_ACTIVE 1
#define GIBTONITE_STABLE 2
-#define GIBTONITE_DETONATE 3
\ No newline at end of file
+#define GIBTONITE_DETONATE 3