From 8ea51f3268329c404f923d6da64dc54a8cf63dca Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 25 Mar 2025 21:07:32 +0000 Subject: [PATCH] Fix the `ispath` SDQL2/Lua wrapper (and add a `is_type_in_typecache` wrapper) (#90207) ## About The Pull Request This fixes the `_ispath` SDQL2 / Lua wrapper: it always passed two arguments, meaning it couldn't be used to just simply check if something was a path _at all_. In addition, I just added wrapper around `is_type_in_typecache` (as it's a define), as that's the whole reason I was using `_ispath` anyways, so it can't hurt. ## Why It's Good For The Game things working properly is nice ## Changelog :cl: fix: The _ispath SDQL2/Lua wrapper can now be used to actually check if something is a path. code: Added the _is_type_in_typecache wrapper, for SDQL2 / Lua scripts. /:cl: --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm index 1305e5a660d..eb9f39a8da4 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2_wrappers.dm @@ -64,6 +64,8 @@ return istype(object, type) /proc/_ispath(path, type) + if(isnull(type)) + return ispath(path) return ispath(path, type) /proc/_length(E) @@ -297,3 +299,6 @@ if(!filter_index || filter_index < 1 || filter_index > length(target.filters)) return animate(target.filters[filter_index], appearance = set_vars, time, loop, easing, flags) + +/proc/_is_type_in_typecache(thing_to_check, typecache) + return is_type_in_typecache(thing_to_check, typecache)