Problem: Source code changes don't take effect

Hi, Ive modified GameViewportClient.cpp (deep in the GitHub folders), saved it, rebuilt the UE4 solution in GitHub folder and executed the batch file called “GenerateProjectFiles”.

The purpose of that change was to make split screen become single screen for local multiplayer, but its not working.

Here’s the original code of a function:

void UGameViewportClient::UpdateActiveSplitscreenType()
{
	ESplitScreenType SplitType = ESplitScreenType(DesiredSplitscreenType);
	int32 NumPlayers = GEngine->GetNumGamePlayers(GetWorld());
	switch ( NumPlayers )
	{
	case 0:
	case 1:
		SplitType = eSST_NONE;
		break;

	case 2:
		if ( (SplitType != eSST_2P_HORIZONTAL) && (SplitType != eSST_2P_VERTICAL) )
		{
			SplitType = ESplitScreenType(Default2PSplitType);
		}
		break;

	case 3:
		if ( (SplitType != eSST_3P_FAVOR_TOP) && (SplitType != eSST_3P_FAVOR_BOTTOM) )
		{
			SplitType = ESplitScreenType(Default3PSplitType);
		}
		break;

	default:
		SplitType = eSST_4P;
		break;
	}

	ActiveSplitscreenType = SplitType;
}

This is the modified version (the one saved and rebuilt):

void UGameViewportClient::UpdateActiveSplitscreenType()
{
	ESplitScreenType SplitType = ESplitScreenType(DesiredSplitscreenType);
	int32 NumPlayers = GEngine->GetNumGamePlayers(GetWorld());

	ActiveSplitscreenType = eSST_NONE;
}

The big question is: why code changes aren’t taking effect? Is it because of the code itself or because the rebuilding process described?

Must be a rebuild problem. That code should accomplish what you want. While not immediate enough for you, hopefully you’ll be happy to know that in 4.1 I’ve added the ability to specify the split types in the project settings.

Thank you Marc, anyway I will still play around with C++ to gain experience on the matter. I’ve finally opted for sublcassing it so I don’t affect all the projects and don’t have to wait a long while for the whole source to rebuild.

When is 4.1 coming, by the way?