[Items] Overhaul Item Hand-in System (#4593)

* [Items] Overhaul Item Hand-in System

* Edge case lua fix

* Merge fix

* I'm going to be amazed if this works first try

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Update linux-build.sh

* Add protections against scripts that hand back items themselves

* Remove EVENT_ITEM_ScriptStopReturn

* test

* Update npc_handins.cpp

* Add Items:AlwaysReturnHandins

* Update spdat.cpp

* Bypass update prompt on CI
This commit is contained in:
Chris Miles
2025-02-03 16:51:09 -06:00
committed by GitHub
parent d1d6db3a09
commit 6fb919a16f
40 changed files with 2254 additions and 473 deletions
+9
View File
@@ -56,6 +56,11 @@ void handle_npc_event_trade(
uint32 extra_data,
std::vector<std::any> *extra_pointers
) {
Lua_NPC l_npc(reinterpret_cast<NPC*>(npc));
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "self");
Lua_Client l_client(reinterpret_cast<Client *>(init));
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
@@ -102,6 +107,10 @@ void handle_npc_event_trade(
lua_pushinteger(L, money_value);
lua_setfield(L, -2, "copper");
// set a reference to the NPC inside the trade object as well for plugins to process
l_npc_o.push(L);
lua_setfield(L, -2, "self");
// set a reference to the client inside of the trade object as well for plugins to process
l_client_o.push(L);
lua_setfield(L, -2, "other");