Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
fix .give crash
Browse files Browse the repository at this point in the history
  • Loading branch information
SurvirvorHRG committed Jan 10, 2021
1 parent 66aeb39 commit 3951ca6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Horion/Command/Commands/GiveCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,23 @@ bool GiveCommand::execute(std::vector<std::string>* args) {
auto transactionManager = g_Data.getLocalPlayer()->getTransactionManager();

if (itemId == 0) {
void* ItemPtr = malloc(0x8);
void* idk = malloc(0x0);
TextHolder tempText(args->at(1));
C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr, idk, tempText);
std::unique_ptr<void*> ItemPtr = std::make_unique<void*>();

This comment has been minimized.

Copy link
@GodGamer029

GodGamer029 Jan 11, 2021

Collaborator

this looks dangerous

This comment has been minimized.

Copy link
@XHiddenProjects

XHiddenProjects Jan 11, 2021

agree

This comment has been minimized.

Copy link
@holybaechu

holybaechu Jan 20, 2021

YES

std::unique_ptr<void*> buffer = std::make_unique<void*>();
C_Item*** cStack = ItemRegistry::lookUpByName(ItemPtr.get(), buffer.get(), tempText);
if (*cStack == nullptr) {
clientMessageF("%sInvalid item name!", RED);
return true;
}
yot = new C_ItemStack(***cStack, count, itemData);
free(ItemPtr);
free(idk);
} else {
void* ItemPtr = malloc(0x8);
C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr, itemId);
std::unique_ptr<void*> ItemPtr = std::make_unique<void*>();
C_Item*** cStack = ItemRegistry::getItemFromId(ItemPtr.get(), itemId);
if (cStack == nullptr || *cStack == nullptr || **cStack == nullptr) {
clientMessageF("%sInvalid item ID!", RED);
return true;
}
yot = new C_ItemStack(***cStack, count, itemData);
free(ItemPtr);
}

if (yot != nullptr)
Expand Down

7 comments on commit 3951ca6

@UltimateBoi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix .enchant on realms and servers for pog

@slitherskull200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix .enchant on realms and servers for pog

why cant you do it yourself?

@UltimateBoi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont code C i code C#

@slitherskull200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont code C i code C#

ok maby you could eventually learn it? so you could help fix the issues you encounter

@XHiddenProjects
Copy link

@XHiddenProjects XHiddenProjects commented on 3951ca6 Jan 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont code C i code C#

ok maby you could eventually learn it? so you could help fix the issues you encounter

@slitherskull200 you really don't need to be so mean/rude about, if the person doesn't know the language, they don't know it. Heck I don't even know C++ or C# or C files since I can't find a compressor to work with.

@slitherskull200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look i wasnt being rude i was just saying they could learn it if they wanted to not go learn it or else

@minhngoc25a
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno why the Issues tab is gone and also, the website: horionbeta.club

Please sign in to comment.