From: <geo...@us...> - 2013-03-30 18:34:40
|
Revision: 5912 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=5912&view=rev Author: geoffthemedio Date: 2013-03-30 18:34:32 +0000 (Sat, 30 Mar 2013) Log Message: ----------- Hopefully fixed issue where planets that lost population and converted to outposts retained their focus setting. Modified Paths: -------------- trunk/FreeOrion/universe/Planet.h trunk/FreeOrion/universe/PopCenter.cpp trunk/FreeOrion/universe/PopCenter.h trunk/FreeOrion/universe/ResourceCenter.h Modified: trunk/FreeOrion/universe/Planet.h =================================================================== --- trunk/FreeOrion/universe/Planet.h 2013-03-29 23:07:43 UTC (rev 5911) +++ trunk/FreeOrion/universe/Planet.h 2013-03-30 18:34:32 UTC (rev 5912) @@ -163,7 +163,7 @@ void SetAvailableTrade(double trade); ///< sets the trade available at this planet for use in building maintenance - void Reset(); ///< Resets the meters, specials, etc., of a planet to an unowned state. This should be called when a planet is wiped out due to starvation, etc. + virtual void Reset(); ///< Resets the meters, specials, etc., of a planet to an unowned state. This should be called when a planet is wiped out due to starvation, etc. void Conquer(int conquerer); ///< Called during combat when a planet changes hands void SetIsAboutToBeColonized(bool b); ///< Called during colonization when a planet is about to be colonized Modified: trunk/FreeOrion/universe/PopCenter.cpp =================================================================== --- trunk/FreeOrion/universe/PopCenter.cpp 2013-03-29 23:07:43 UTC (rev 5911) +++ trunk/FreeOrion/universe/PopCenter.cpp 2013-03-30 18:34:32 UTC (rev 5912) @@ -101,7 +101,7 @@ void PopCenter::PopCenterPopGrowthProductionResearchPhase() { float cur_pop = CurrentMeterValue(METER_POPULATION); - float pop_growth = NextTurnPopGrowth(); // may be negative + float pop_growth = NextTurnPopGrowth(); // may be negative float new_pop = cur_pop + pop_growth; //if (cur_pop > 0.0) @@ -115,9 +115,8 @@ } } -void PopCenter::PopCenterClampMeters() { - GetMeter(METER_POPULATION)->ClampCurrentToRange(); -} +void PopCenter::PopCenterClampMeters() +{ GetMeter(METER_POPULATION)->ClampCurrentToRange(); } void PopCenter::Reset() { GetMeter(METER_POPULATION)->Reset(); Modified: trunk/FreeOrion/universe/PopCenter.h =================================================================== --- trunk/FreeOrion/universe/PopCenter.h 2013-03-29 23:07:43 UTC (rev 5911) +++ trunk/FreeOrion/universe/PopCenter.h 2013-03-30 18:34:32 UTC (rev 5912) @@ -36,13 +36,13 @@ //@} /** \name Mutators */ //@{ - void Copy(const PopCenter* copied_object, Visibility vis = VIS_FULL_VISIBILITY); - void SetSpecies(const std::string& species_name);///< sets the species of the population to \a species_name - void Reset(); ///< Sets all meters to 0, clears race name + void Copy(const PopCenter* copied_object, Visibility vis = VIS_FULL_VISIBILITY); + void SetSpecies(const std::string& species_name); ///< sets the species of the population to \a species_name + virtual void Reset(); ///< Sets all meters to 0, clears race name //@} protected: - void Init(); ///< initialization that needs to be called by derived class after derived class is constructed + void Init(); ///< initialization that needs to be called by derived class after derived class is constructed float PopCenterNextTurnMeterValue(MeterType meter_type) const;///< returns estimate of the next turn's current values of meters relevant to this PopCenter void PopCenterResetTargetMaxUnpairedMeters(); Modified: trunk/FreeOrion/universe/ResourceCenter.h =================================================================== --- trunk/FreeOrion/universe/ResourceCenter.h 2013-03-29 23:07:43 UTC (rev 5911) +++ trunk/FreeOrion/universe/ResourceCenter.h 2013-03-30 18:34:32 UTC (rev 5912) @@ -48,7 +48,7 @@ void SetFocus(const std::string& focus); - void Reset(); ///< Resets the meters, etc. This should be called when a ResourceCenter is wiped out due to starvation, etc. + virtual void Reset(); ///< Resets the meters, etc. This should be called when a ResourceCenter is wiped out due to starvation, etc. //@} protected: |