mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 23:58:25 +00:00
[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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user