Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 10-19-2009, 11:42 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

As per KLS' suggestion, I should use new instead of malloc(), so I am going to. I should also free memory :P

Code:
void Client::DoTributeUpdate() {
	
	const Item_Struct* myitem = database.GetItem(1001);
	Item_Struct* item = new Item_Struct;
	memcpy(item, myitem, sizeof(Item_Struct));

	if(GetLevel() >= 76 && this->GetClientVersion() == EQClientSoF)
	{
		item->HP += (CalcBaseHP() - 5);
		item->Mana += (CalcMaxMana() - 5);
		item->Endur += (this->max_end - 5);
	}


	const Item_Struct* item2 = item;
	ItemInst* myinst = database.CreateBaseItem(item2);
	SendFakeItem(400, myinst, ItemPacketTributeItem);
	delete item;
        delete myinst;
	return;
			
}

Last edited by Secrets; 10-19-2009 at 11:47 PM.. Reason: forgot myinst cleanup
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:56 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3