any suggestions?
Code: Select all
for(vector<UnitDef::UnitDefWeapon>::const_iterator weapon = unitList[def_id-1]->weapons.begin(); weapon != unitList[def_id-1]->weapons.end(); ++weapon)
{
if(weapon->def->stockpile)
return true;
}
return false;
Moderators: hoijui, Moderators
Code: Select all
for(vector<UnitDef::UnitDefWeapon>::const_iterator weapon = unitList[def_id-1]->weapons.begin(); weapon != unitList[def_id-1]->weapons.end(); ++weapon)
{
if(weapon->def->stockpile)
return true;
}
return false;
This is the only place where onlyTargetCategory is modified, so it equals 0xffffffff if toairweapon is set to 0, and is different than 0xffffffff if toairweapon is set to 1.WeaponDefHandler.cpp wrote:Code: Select all
weaponDefs[id].onlyTargetCategory=0xffffffff; if(atoi(sunparser->SGetValueDef("0", weaponname + \\toairweapon").c_str())){ weaponDefs[id].onlyTargetCategory=CCategoryHandler::Instance()->GetCategories("VTOL"); //fix if we sometime call aircrafts otherwise }
Code: Select all
def->type == string("Dgun")