From 86b9ccfa4dd74a59cdc5a43ee027f7836f3084f3 Mon Sep 17 00:00:00 2001 From: quaK <38787176+Joelrau@users.noreply.github.com> Date: Fri, 10 Mar 2023 05:30:06 +0200 Subject: [PATCH] fix crash --- src/client/component/stats.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/component/stats.cpp b/src/client/component/stats.cpp index b43931af..d5fc285e 100644 --- a/src/client/component/stats.cpp +++ b/src/client/component/stats.cpp @@ -219,14 +219,17 @@ namespace stats return is_unlocked2_hook.invoke(a1, a2, unlock_table, value); } - int item_quantity(__int64 a1, unsigned int a2, int a3) + int item_quantity(__int64 a1, int a2, int id) { - if (dvars::cg_unlockall_loot && dvars::cg_unlockall_loot->current.enabled) + auto result = item_quantity_hook.invoke(a1, a2, id); + + // 30000 crashes + if (id != 30000 && dvars::cg_unlockall_loot && dvars::cg_unlockall_loot->current.enabled) { return 1; } - - return item_quantity_hook.invoke(a1, a2, a3); + + return result; } void com_ddl_print_state(const game::DDLState* state, const game::DDLContext* context)