Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why
This commit is contained in:
TalkingCactus
2016-09-10 00:31:01 -04:00
committed by Poojawa
parent 315c5a4a4e
commit 9d9a93335b
87 changed files with 5041 additions and 5383 deletions

39
code/controllers/hooks.dm Normal file
View File

@@ -0,0 +1,39 @@
/**
* @file hooks.dm
* Implements hooks, a simple way to run code on pre-defined events.
*/
/** @page hooks Code hooks
* @section hooks Hooks
* A hook is defined under /hook in the type tree.
*
* To add some code to be called by the hook, define a proc under the type, as so:
* @code
/hook/foo/proc/bar()
if(1)
return 1 //Sucessful
else
return 0 //Error, or runtime.
* @endcode
* All hooks must return nonzero on success, as runtimes will force return null.
*/
/**
* Calls a hook, executing every piece of code that's attached to it.
* @param hook Identifier of the hook to call.
* @returns 1 if all hooked code runs successfully, 0 otherwise.
*/
/proc/callHook(hook, list/args=null)
var/hook_path = text2path("/hook/[hook]")
if(!hook_path)
// error("Invalid hook '/hook/[hook]' called.")
return 0
var/caller = new hook_path
var/status = 1
for(var/P in typesof("[hook_path]/proc"))
if(!call(caller, P)(arglist(args)))
// error("Hook '[P]' failed or runtimed.")
status = 0
return status