Page 1 of 1

accessing spell data

Posted: Thu Apr 04, 2019 10:37 am
by Ememjr
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

Re: accessing spell data

Posted: Thu Apr 04, 2019 7:21 pm
by Jabantiz
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