mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-18 02:03:52 +00:00
Port over RCE Patches from LCEMP (#1023)
* LCEMP RCE Fixes WIP
Based on d017bfc30a
* Update to LCEMP's ByteArrayIO version
Fixes compilation since ours was missing some revisions from LCEMP
* Add additional safety checks missed in first pass
* Remove duplicate recipe count check
This commit is contained in:
parent
a358a3caae
commit
bda3b1078a
32 changed files with 372 additions and 203 deletions
|
|
@ -1588,13 +1588,13 @@ void PlayerConnection::handleCraftItem(shared_ptr<CraftItemPacket> packet)
|
|||
if(iRecipe == -1)
|
||||
return;
|
||||
|
||||
int recipeCount = (int)Recipes::getInstance()->getRecipies()->size();
|
||||
if(iRecipe < 0 || iRecipe >= recipeCount)
|
||||
return;
|
||||
|
||||
Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray();
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
|
||||
size_t recipeCount = Recipes::getInstance()->getRecipies()->size();
|
||||
if (iRecipe < 0 || iRecipe >= (int)recipeCount)
|
||||
return;
|
||||
|
||||
if(app.DebugSettingsOn() && (player->GetDebugOptions()&(1L<<eDebugSetting_CraftAnything)))
|
||||
{
|
||||
pTempItemInst->onCraftedBy(player->level, dynamic_pointer_cast<Player>( player->shared_from_this() ), pTempItemInst->count );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue