accessing spell data

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

accessing spell data

Post by Ememjr » Thu Apr 04, 2019 10:37 am

in this beginning of a function

Code: Select all

void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, Client* client,  bool display_tier) {
	//////////Spell* spell2 = master_spell_list.GetSpell(spell->id, spell->tier + 1);
	
	
	packet->setDataByName("current_id", spell->id);
	packet->setDataByName("current_icon", spell->icon);
	packet->setDataByName("current_icon2", spell->icon_heroic_op);	// fix struct element name eventually
	packet->setDataByName("current_icontype", spell->icon_backdrop);	// fix struct element name eventually
spell already contains data which can be used as in the 4 setDataByName lines

i have the need to access the next tier of the spell in this function as well, as seen here

Code: Select all

        packet->setDataByName("next_id", spell2->id);
	packet->setDataByName("next_icon", spell2->icon);
	packet->setDataByName("next_icon2", spell2->icon_heroic_op);	// fix struct element name eventually
	packet->setDataByName("next_icontype", spell2->icon_backdrop);	// fix struct element name eventually
the commented line above i thought would put the spell into spell2 but spell2->id these show as class spell has no member id

i am sure this is a simple were , where am i going wrong

i did try using spell2->spell.id but that says expression must have a class type

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: accessing spell data

Post by Jabantiz » Thu Apr 04, 2019 7:21 pm

Without looking at the code i can't be sure but I believe spell class has an info or details struct in it that would contain the id

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests