mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-06-04 00:24:35 +00:00
fix: add splitscreen, fix dlcs not loading, major RCE vuln fix on packet net, fix chunk loading on non-server clients, persistent saves
note: I changed how XUID works, player data might be wiped on old saves, save items on a chest or similar before trying to load old saves on new version
This commit is contained in:
@@ -155,6 +155,9 @@ shared_ptr<ItemInstance> AbstractContainerMenu::clicked(int slotIndex, int butto
|
||||
shared_ptr<ItemInstance> clickedEntity = nullptr;
|
||||
shared_ptr<Inventory> inventory = player->inventory;
|
||||
|
||||
if (slotIndex != CLICKED_OUTSIDE && (slotIndex < 0 || slotIndex >= (int)slots->size()))
|
||||
return nullptr;
|
||||
|
||||
if ((clickType == CLICK_PICKUP || clickType == CLICK_QUICK_MOVE) && (buttonNum == 0 || buttonNum == 1))
|
||||
{
|
||||
if (slotIndex == CLICKED_OUTSIDE)
|
||||
@@ -403,12 +406,13 @@ bool AbstractContainerMenu::isPauseScreen()
|
||||
|
||||
void AbstractContainerMenu::setItem(unsigned int slot, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if (slot >= slots->size()) return;
|
||||
getSlot(slot)->set(item);
|
||||
}
|
||||
|
||||
void AbstractContainerMenu::setAll(ItemInstanceArray *items)
|
||||
{
|
||||
for (unsigned int i = 0; i < items->length; i++)
|
||||
for (unsigned int i = 0; i < items->length && i < slots->size(); i++)
|
||||
{
|
||||
getSlot(i)->set( (*items)[i] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user