diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 0bf19e93e..852f4e29d 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1504,8 +1504,18 @@ static const luaL_Reg dfhack_gui_funcs[] = { /***** Job module *****/ -static bool jobEqual(df::job *job1, df::job *job2) { return *job1 == *job2; } -static bool jobItemEqual(df::job_item *job1, df::job_item *job2) { return *job1 == *job2; } +static bool jobEqual(const df::job *job1, const df::job *job2) +{ + CHECK_NULL_POINTER(job1); + CHECK_NULL_POINTER(job2); + return *job1 == *job2; +} +static bool jobItemEqual(const df::job_item *job1, const df::job_item *job2) +{ + CHECK_NULL_POINTER(job1); + CHECK_NULL_POINTER(job2); + return *job1 == *job2; +} static const LuaWrapper::FunctionReg dfhack_job_module[] = { WRAPM(Job,cloneJobStruct), diff --git a/library/modules/Job.cpp b/library/modules/Job.cpp index 132dcfc4b..eccb70b7e 100644 --- a/library/modules/Job.cpp +++ b/library/modules/Job.cpp @@ -129,9 +129,6 @@ void DFHack::Job::deleteJobStruct(df::job *job, bool keptEverything) bool DFHack::operator== (const df::job_item &a, const df::job_item &b) { - CHECK_NULL_POINTER(&a); - CHECK_NULL_POINTER(&b); - if (!(CMP(item_type) && CMP(item_subtype) && CMP(mat_type) && CMP(mat_index) && CMP(flags1.whole) && CMP(quantity) && CMP(vector_id) && @@ -152,9 +149,6 @@ bool DFHack::operator== (const df::job_item &a, const df::job_item &b) bool DFHack::operator== (const df::job &a, const df::job &b) { - CHECK_NULL_POINTER(&a); - CHECK_NULL_POINTER(&b); - if (!(CMP(job_type) && CMP(job_subtype) && CMP(mat_type) && CMP(mat_index) && CMP(item_subtype) && CMP(item_category.whole) &&