From: <geo...@us...> - 2012-09-16 18:07:11
|
Revision: 5248 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=5248&view=rev Author: geoffthemedio Date: 2012-09-16 18:07:05 +0000 (Sun, 16 Sep 2012) Log Message: ----------- ValueRef parsing tweaks, including fixing UniverseCentreX and Y which were being treated as ints needing casting to doubles, rather than natively doubles as they actually are. Modified Paths: -------------- trunk/FreeOrion/parse/DoubleValueRefParser.cpp trunk/FreeOrion/parse/IntValueRefParser.cpp Modified: trunk/FreeOrion/parse/DoubleValueRefParser.cpp =================================================================== --- trunk/FreeOrion/parse/DoubleValueRefParser.cpp 2012-09-16 18:05:30 UTC (rev 5247) +++ trunk/FreeOrion/parse/DoubleValueRefParser.cpp 2012-09-16 18:07:05 UTC (rev 5248) @@ -65,14 +65,16 @@ ) ) | ( - ( tok.CurrentTurn_ - | tok.UniverseCentreX_ - | tok.UniverseCentreY_ - ) + tok.CurrentTurn_ [ push_back(_a, _1), _val = new_<ValueRef::StaticCast<int, double> >(new_<ValueRef::Variable<int> >(_a)) ] ) - | ( - tok.Value_ [ push_back(_a, _1), _val = new_<ValueRef::Variable<double> >(_a) ] + | (( + tok.Value_ + | tok.UniverseCentreX_ + | tok.UniverseCentreY_ + // add more object-independent ValueRef int functions here + ) + [ push_back(_a, _1), _val = new_<ValueRef::Variable<double> >(_a) ] ) ; Modified: trunk/FreeOrion/parse/IntValueRefParser.cpp =================================================================== --- trunk/FreeOrion/parse/IntValueRefParser.cpp 2012-09-16 18:05:30 UTC (rev 5247) +++ trunk/FreeOrion/parse/IntValueRefParser.cpp 2012-09-16 18:07:05 UTC (rev 5248) @@ -69,7 +69,8 @@ ) | ( tok.CurrentTurn_ - | tok.Value_ + | tok.Value_ + // add more object-independent ValueRef int functions here ) [ push_back(_a, _1) ] ) |