CAPS, movement class

CAPS, movement class

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

CAPS, movement class

Post by FoeOfTheBee »

If I read this code correctly, BOAT, HOVER, SHIP, and TANK all need to be in caps in the FBI file. Is this right?

Code: Select all

if(name.find("BOAT")!=string::npos || name.find("SHIP")!=string::npos){
			md->moveType=MoveData::Ship_Move;
			md->depth=atof(parser.SGetValueDef("10",class_name+"\\MinWaterDepth").c_str());
//			info->AddLine("class %i %s boat",num,name.c_str());
			md->moveFamily=3;
		} else if(name.find("HOVER")!=string::npos){
			md->moveType=MoveData::Hover_Move;
			md->maxSlope=1-cos(atof(parser.SGetValueDef("10",class_name+"\\MaxSlope").c_str())*1.5*PI/180);
			md->moveFamily=2;
//			info->AddLine("class %i %s hover",num,name.c_str());
		} else {
			md->moveType=MoveData::Ground_Move;	
			md->depthMod=0.1;
			md->depth=atof(parser.SGetValueDef("0",class_name+"\\MaxWaterDepth").c_str());
			md->maxSlope=1-cos(atof(parser.SGetValueDef("60",class_name+"\\MaxSlope").c_str())*1.5*PI/180);
//			info->AddLine("class %i %s ground",num,name.c_str());
			if(name.find("TANK")!=string::npos)
				md->moveFamily=0;
			else
				md->moveFamily=1;
		}
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

It depends how the find method works, but probably, yes - i think it is from modding experience, of course, I could be wrong. :wink:
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

yeah, std::string::find is case sensitive, so they have to be in uppercase in the file apparently.
Post Reply

Return to “Game Development”