Hello, recently i separated one file intro multyple, now i am having compiler complain some of classes having unknown variables.
//The function
int Object::GetAttackDamage()
{
int damage = 0;
if (inventory != NULL)
{
BaseItem * equWep = unit->GetEquipedWeapon();
if (equWep != NULL)
{
damage += equWep->wepDamage;
}
}
if(unit)
damage += unit->attackDamage;
return damage;
}
//The error
C:/Prog/Code/src/Objects.cpp:155:22: error: 'class BaseItem' has no member named 'wepDamage'
damage += equWep->wepDamage;
I can confirm that Objects.cpp includes Inventory.h which includes BaseItem.h Which has class BaseItem which inherites BaseItemWeapon which has this member, its publicly inherited so its visible. I don't know whats happening, or what have i done wrong
Here are raw cut outs of data from project, its clearly visible it is correct AFAIK.
What are common issues, and how would i go solving this issue? I have no clue what to do...