Adds support for multiple callback checks for the do_after and incapacitated procs (#13057)

* do_after refactor

Update slime.dm

fix a comment

if you read this you get a cookie!

* some little tweaks

Changes a TRUE to FALSE in a comment, got confused there.

Removes the code that checks for non-callbacks in the extra_checks list and removes them. It should be up to the dev to not add non-callbacks to this list. I'd rather have it runtime instead

* check_for_true_callbacks

* CRLF to LF

Co-authored-by: SteelSlayer <SteelSlayer@users.noreply.github.com>
This commit is contained in:
SteelSlayer
2020-03-21 18:21:12 -06:00
committed by GitHub
co-authored by SteelSlayer
parent bdafa40b40
commit 63ea21b20e
7 changed files with 64 additions and 28 deletions
@@ -16,11 +16,11 @@
var/datum/callback/tool_check = CALLBACK(src, .proc/tool_check_callback, user, target, amount, extra_checks)
if(ismob(target))
if(!do_mob(user, target, delay, extra_checks=tool_check))
if(!do_mob(user, target, delay, extra_checks = list(tool_check)))
return
else
if(!do_after(user, delay, target=target, extra_checks=tool_check))
if(!do_after(user, delay, target=target, extra_checks = list(tool_check)))
return
else
// Invoke the extra checks once, just in case.