diff --git a/Content/BattleField/BattleFieldMap.umap b/Content/BattleField/BattleFieldMap.umap index a9d9ff1..a8e5f1e 100644 Binary files a/Content/BattleField/BattleFieldMap.umap and b/Content/BattleField/BattleFieldMap.umap differ diff --git a/Source/TurnBasedTutorial/MyGameMode.cpp b/Source/TurnBasedTutorial/MyGameMode.cpp index ae6b98e..44dd9cc 100644 --- a/Source/TurnBasedTutorial/MyGameMode.cpp +++ b/Source/TurnBasedTutorial/MyGameMode.cpp @@ -11,9 +11,12 @@ AMyGameMode::AMyGameMode() : Super() { DefaultPawnClass = AMyPawn::StaticClass(); } -AActor *AMyGameMode::ChoosePlayerStart(AController *Player) { +AActor *AMyGameMode::ChoosePlayerStart_Implementation(AController *Player) { + UE_LOG(LogTemp, Warning, TEXT("GameMode ChoosePlayerStart %d"), GetNumPlayers()); InitializeSpawnPointsIfNeeded(); - return *SpawnPoints.Find(GetNumPlayers()); + auto ptr = *SpawnPoints.Find(GetNumPlayers()); + UE_LOG(LogTemp, Warning, TEXT("GameMode ChoosePlayerStart end %d"), ptr->GetPlayerIndex()); + return ptr; } void AMyGameMode::InitializeSpawnPointsIfNeeded() { @@ -21,7 +24,8 @@ void AMyGameMode::InitializeSpawnPointsIfNeeded() { return; } for (TActorIterator PlayerStartIterator(GetWorld()); PlayerStartIterator; ++PlayerStartIterator) { - SpawnPoints[PlayerStartIterator->GetPlayerIndex()] = *PlayerStartIterator; + UE_LOG(LogTemp, Warning, TEXT("PlayerStart iterator %d"), PlayerStartIterator->GetPlayerIndex()); + SpawnPoints.Add(PlayerStartIterator->GetPlayerIndex(), *PlayerStartIterator); } } diff --git a/Source/TurnBasedTutorial/MyGameMode.h b/Source/TurnBasedTutorial/MyGameMode.h index b7ba335..df523f1 100644 --- a/Source/TurnBasedTutorial/MyGameMode.h +++ b/Source/TurnBasedTutorial/MyGameMode.h @@ -23,7 +23,7 @@ public: void BeginPlay() override; - AActor *ChoosePlayerStart(AController * Player); + AActor *ChoosePlayerStart_Implementation(AController * Player); private: void StartGame(); diff --git a/Source/TurnBasedTutorial/MyPlayerState.cpp b/Source/TurnBasedTutorial/MyPlayerState.cpp deleted file mode 100644 index 00bda13..0000000 --- a/Source/TurnBasedTutorial/MyPlayerState.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "MyPlayerState.h" - diff --git a/Source/TurnBasedTutorial/MyPlayerState.h b/Source/TurnBasedTutorial/MyPlayerState.h deleted file mode 100644 index 991a5cb..0000000 --- a/Source/TurnBasedTutorial/MyPlayerState.h +++ /dev/null @@ -1,17 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "GameFramework/PlayerState.h" -#include "MyPlayerState.generated.h" - -/** - * - */ -UCLASS() -class TURNBASEDTUTORIAL_API AMyPlayerState : public APlayerState -{ - GENERATED_BODY() - -};