From: <wel...@us...> - 2010-11-28 09:05:49
|
Revision: 6461 http://planeshift.svn.sourceforge.net/planeshift/?rev=6461&view=rev Author: weltall2 Date: 2010-11-28 09:05:43 +0000 (Sun, 28 Nov 2010) Log Message: ----------- inverted code in the if as it was wrongly placed. note the parent uid won't get to the first level this way. so either the uid has to be put locally during init or you should make a method to reach the top parent Modified Paths: -------------- trunk/src/common/util/mathscript.cpp Modified: trunk/src/common/util/mathscript.cpp =================================================================== --- trunk/src/common/util/mathscript.cpp 2010-11-27 23:20:59 UTC (rev 6460) +++ trunk/src/common/util/mathscript.cpp 2010-11-28 09:05:43 UTC (rev 6461) @@ -354,17 +354,18 @@ // assign a new ID if(parent) { - ID.ID.value = ++UID; + // this const_cast is bad and should be removed + ID.ID.value = ++(const_cast<MathEnvironment*>(parent)->UID); } else { - // this const_cast is bad and should be removed - ID.ID.value = ++(const_cast<MathEnvironment*>(parent)->UID); + ID.ID.value = ++UID; + } - // add to the lookup table - scriptableVariables.Put(ID.ID.value,p); - scriptableRegistry.Put(p,ID.ID.value); - } + // add to the lookup table + scriptableVariables.Put(ID.ID.value,p); + scriptableRegistry.Put(p,ID.ID.value); + } // return masked value This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |