Name: Anonymous 2007-07-05 4:10 ID:gbn8N62F
I have a vector of a class of units:
In Unit the constructor Unit::Unit() has a boolean value 'selected'. calling .select sets it to true
but for some reason when i go through each unit in the vector:
it resets all values as if it got created again, with selected turning false. but
select does change inside the function, but not in the class. why would it do that?
std::vector<Unit> Units; //list of unitsIn Unit the constructor Unit::Unit() has a boolean value 'selected'. calling .select sets it to true
but for some reason when i go through each unit in the vector:
for(int i=0;i < Units.size(); i++){
Units.at(i).select(driver,images);
}it resets all values as if it got created again, with selected turning false. but
unit.select();select does change inside the function, but not in the class. why would it do that?