src/game/Tactical/Map_Information.cc
BOOLEAN ValidateEntryPointGridNo( INT16 *sGridNo )
{
	INT16 sWorldX, sWorldY;
	INT16 sTopLimit, sBottomLimit;

	if( *sGridNo < 0 )
		return FALSE; //entry point is non-existant

	sTopLimit = 80;
	sBottomLimit = gsBottomY - gsTopY - 40;

	//Get screen coordinates for current gridno
	GetAbsoluteScreenXYFromMapPos(*sGridNo, &sWorldX, &sWorldY);

	if( sWorldY < sTopLimit )
	{
		*sGridNo = GetMapPosFromAbsoluteScreenXY(sWorldX, sTopLimit);
	}
	else if( sWorldY > sBottomLimit )
	{
		*sGridNo = GetMapPosFromAbsoluteScreenXY(sWorldX, sBottomLimit);
	}
	else
	{
		return FALSE; //already valid
	}

	return TRUE; //modified
}
//EntryPoints can't be placed on the top two gridnos in a map.  So all we do in this case
//is return the closest gridno.  Returns TRUE if the mapindex changes.
EntryPoints can't be placed on the top two gridnos in a map.  So all we do in this case
is return the closest gridno.  Returns TRUE if the mapindex changes.
EntryPoints can ' t be placed on the top two gridnos in a map . So all we do in this case is return the closest gridno . Returns TRUE if the mapindex changes .
BOOLEAN ValidateEntryPointGridNo( INT16 *sGridNo )
{
	INT16 sWorldX, sWorldY;
	INT16 sTopLimit, sBottomLimit;
	if( *sGridNo < 0 )
		return FALSE; 
	sTopLimit = 80;
	sBottomLimit = gsBottomY - gsTopY - 40;
	GetAbsoluteScreenXYFromMapPos(*sGridNo, &sWorldX, &sWorldY);
	if( sWorldY < sTopLimit )
	{
		*sGridNo = GetMapPosFromAbsoluteScreenXY(sWorldX, sTopLimit);
	}
	else if( sWorldY > sBottomLimit )
	{
		*sGridNo = GetMapPosFromAbsoluteScreenXY(sWorldX, sBottomLimit);
	}
	else
	{
		return FALSE; 
	}
	return TRUE; 
}
BOOLEAN ValidateEntryPointGridNo ( INT16 * sGridNo ) { INT16 sWorldX , sWorldY ; INT16 sTopLimit , sBottomLimit ; if ( * sGridNo < 0 ) return FALSE ; sTopLimit = 80 ; sBottomLimit = gsBottomY - gsTopY - 40 ; GetAbsoluteScreenXYFromMapPos ( * sGridNo , & sWorldX , & sWorldY ) ; if ( sWorldY < sTopLimit ) { * sGridNo = GetMapPosFromAbsoluteScreenXY ( sWorldX , sTopLimit ) ; } else if ( sWorldY > sBottomLimit ) { * sGridNo = GetMapPosFromAbsoluteScreenXY ( sWorldX , sBottomLimit ) ; } else { return FALSE ; } return TRUE ; }
EntryPoints can't be placed on the top two gridnos in a map.
EntryPoints can ' t be placed on the top two gridnos in a map .
//entry point is non-existant //Get screen coordinates for current gridno //already valid //modified