Eluna icon indicating copy to clipboard operation
Eluna copied to clipboard

Add SendVendorWindow

Open illunix opened this issue 5 years ago • 8 comments

illunix avatar Sep 10 '20 18:09 illunix

What emulators has this been tested with? Please make sure to add proper defines for what emulator it works with to prevent compile errors for others.

Foereaper avatar Sep 12 '20 16:09 Foereaper

I've tested it on TC and AC, defines is same for both emulators @Foereaper

illunix avatar Sep 12 '20 16:09 illunix

What does this do differently to Player:SendListInventory? From what I can tell this is what you want to achieve?

Foereaper avatar Sep 12 '20 16:09 Foereaper

CI was added and it shows that the build fails for all other cores except AC. It seems that the code requires multivendor, which is not present on other cores. https://github.com/ElunaLuaEngine/Eluna/pull/326/checks?check_run_id=1119685708#step:6:518

Rochet2 avatar Sep 15 '20 20:09 Rochet2

Alrighty then I will edit it and this method will be only available for AC @Rochet2

illunix avatar Sep 15 '20 21:09 illunix

The changes could probably be merged with the SendListInventory function that Foereaper mentions.

Rochet2 avatar Sep 15 '20 21:09 Rochet2

Idk what you mean

illunix avatar Sep 15 '20 21:09 illunix

https://github.com/ElunaLuaEngine/Eluna/blob/a22fdc639a1964b39379e738e9776c33fe8b0d4e/PlayerMethods.h#L2350-L2356

    int SendVendorWindow(lua_State* L, Player* player)
    {
        Unit* sendTo = sEluna->CHECKOBJ<Unit>(L, 2);
        uint32 creatureEntry = Eluna::CHECKVAL<uint32>(L, 3);
        player->GetSession()->SendListInventory(sendTo->GET_GUID(), creatureEntry);
        return 0;
    }

If you compare the existing code and your code, there is only one difference. Instead of making an entirely new function you can add the small change to the existing function.

Rochet2 avatar Sep 15 '20 21:09 Rochet2