From 6f5376e01d860cbaeb86945305dc525b216b7443 Mon Sep 17 00:00:00 2001 From: eyakm1 Date: Wed, 15 Mar 2023 05:55:03 +0300 Subject: [PATCH] Some fixes and debug output --- Content/BattleField/BattleFieldMap.umap | Bin 634260 -> 634260 bytes Source/TurnBasedTutorial/MyGameMode.cpp | 10 +++++++--- Source/TurnBasedTutorial/MyGameMode.h | 2 +- Source/TurnBasedTutorial/MyPlayerState.cpp | 5 ----- Source/TurnBasedTutorial/MyPlayerState.h | 17 ----------------- 5 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 Source/TurnBasedTutorial/MyPlayerState.cpp delete mode 100644 Source/TurnBasedTutorial/MyPlayerState.h diff --git a/Content/BattleField/BattleFieldMap.umap b/Content/BattleField/BattleFieldMap.umap index a9d9ff19004948388ceee017abaa71b22458c76a..a8e5f1e27d3e1fe06ace28d80e7abc3939b81045 100644 GIT binary patch delta 461 zcmbPoTW!j1wGC#B0+J?9a{Nv^N|?(+7vBs%AiUX)aj~Hg69WSS2M`;u00|&SYM*?u zNNw^?BLg93AQvPh01^j+N!=i+&7H;>jEp>+KbZ)#a_RzwRe@M-GM|+=rv{M42*jF` z^{n)HK&*rR|NjS444X5pj5WASbq$R4j4bsGEjBMpl3?d{m~#{)$-pqpd2&Oh9go8t zR~Uc!=KzA zI8|cvgqC|uo9o(DSSGK?71+F}dm59#yCcU_4tOS4)OO$5VJ%d7eX?S%?B>+IIc&NN zJkAUZK|svFFd0NZ0m!=y3<1X^*h4)9!#$#xEZ)^WiEp#s)OXC&7x1!hGdfLvIJ0Q7 zbRO5_*E0+!7clZn&Yuys`NOOkjLqj~x1XQQ2*gZ4%nZaVK+FonY(UHo#2nkt&*nTT F2mpt6mK6X1 delta 441 zcmbPoTW!j1wGC#B0-rpsuc*5`?{oSr*ICNBz<;wF<6=W0Mg|534j>i)Vh~7bpM0@M zZSqbd2c{x0b91M01|uW$=1(TVtek2<6{n*cRu_{#h4=5ms*2tm|Q&Y~La=`D`9B^{zp|{%MD@UWKwf8H zP?5SIHN{Ki>4UC6EC0k>ZrH3h^&K-$3zwaXi*n*ok%$#8lON7B>&|v 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() - -};