Page 1 of 1

Help with custom code

Posted: Mon Jan 08, 2018 10:28 am
by dragonarmor
I am doing some custom server coding and need help with compile error:
It's on the "if(battleutils::CalculateSpellCost" line

player_charm_controller.cpp(2650): error C2664: 'CSpell *spell::GetSpell(SpellID)': cannot convert argument 1 from 'uint16' to 'SpellID'

Code: Select all

		// *** If no healing is needed but I need to Raise someone, then pick a Raise Spell ***
		if ((SpellID == 13) || (SpellID == 12 && IsMainHealer)) {
			SpellID = 0;
			TestSpellID = 12; // RAISE I
			if (charutils::hasSpell(PCaster, TestSpellID) && PCaster->CanUseSpell(spell::GetSpell(TestSpellID))) {
				if ((!PCaster->PRecastContainer->HasRecast(RECAST_MAGIC, TestSpellID, 0))) {
					if (battleutils::CalculateSpellCost(POwner, spell::GetSpell(TestSpellID)) < PCaster->health.mp)
					{
						SpellID = TestSpellID; // Pick RAISE I
					}
				}
			}
			TestSpellID = 13; // RAISE II
			if (charutils::hasSpell(PCaster, TestSpellID) && PCaster->CanUseSpell(spell::GetSpell(TestSpellID))) {
				if ((!PCaster->PRecastContainer->HasRecast(RECAST_MAGIC, TestSpellID, 0))) {
					if (battleutils::CalculateSpellCost(POwner, spell::GetSpell(TestSpellID)) < PCaster->health.mp)
					{
						SpellID = TestSpellID; // Pick RAISE II
					}
				}
			}