blaster/Source/Blaster/GameMode/LobbyGameMode.cpp

23 lines
487 B
C++
Raw Normal View History

2022-04-28 23:33:04 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "LobbyGameMode.h"
#include "GameFramework/GameStateBase.h"
void ALobbyGameMode::PostLogin(APlayerController* NewPlayer)
{
Super::PostLogin(NewPlayer);
int32 NumberOfPlayers = GameState.Get()->PlayerArray.Num();
if (NumberOfPlayers == 2)
{
UWorld* World = GetWorld();
if (World)
{
bUseSeamlessTravel = true;
World->ServerTravel(FString("/Game/Maps/BlasterMap?listen"));
}
}
}