Mass for features
Posted: 19 Nov 2006, 17:10
At the moment feature definitions have the mass hardcoded:
https://taspring.clan-sy.com/svn/spring ... andler.cpp
Make it:
I don't know what "atof" is and the others get passed a string instead of a float (float defaultMass) so you better change that to .. whatever.
Basically, just make features also have mass defined by the TDFs.
https://taspring.clan-sy.com/svn/spring ... andler.cpp
Code: Select all
FeatureDef* CFeatureHandler::GetFeatureDef(const std::string name)
{
fd->mass=fd->metal*0.4f+fd->maxHealth*0.1f;
}
Code: Select all
FeatureDef* CFeatureHandler::GetFeatureDef(const std::string name)
{
float defaultMass= metal*0.4f+fd->maxHealth*0.1f;
fd->mass= atof (wreckParser.SGetValueDef (defaultMass, name + "\\Mass").c_str ());
}
Basically, just make features also have mass defined by the TDFs.