diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index c5c3b84e..e286f8dc 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 -size 158206 +oid sha256:5dac3cf2a8cecffb55df47f8f2a5c7375a61413dea80a5fe0440772fb53a0f20 +size 43745 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 25736cf7..0f990580 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1162d7ede8b7665739cbded7d0d408820d4dce7211751153f69760e4d5dfa55 -size 66790690 +oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d +size 72364642 diff --git a/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp b/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp index 949b914a..79eb097f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp @@ -38,9 +38,26 @@ void ANPC_Manager::BeginPlay() if (NPC_StationClasses.IsEmpty()) return; FRotator DefaultRot = FRotator(0, 0, 0); + int StationSlots = (StationPoints.Num() / NPC_StationClasses.Num()) + 1; + TArray NumOfUniqueStations; + for (auto UniqueStation : NPC_StationClasses) + { + NumOfUniqueStations.Add(StationSlots); + } for (FVector StationPoint : StationPoints) { - int RandInt = FMath::RandRange(0, NPC_StationClasses.Num() - 1); + bool FoundRandomFairInt = false; + int RandInt = 0; + while (!FoundRandomFairInt) + { + RandInt = FMath::RandRange(0, NPC_StationClasses.Num() - 1); + if (NumOfUniqueStations[RandInt] > 0) + { + NumOfUniqueStations[RandInt]--; + FoundRandomFairInt = true; + } + } + FVector StationPointWorldLocation = StationPoint + GetActorLocation(); ANPC_Station* NPC_Station = GetWorld()->SpawnActor(NPC_StationClasses[RandInt], StationPointWorldLocation, DefaultRot); if (IsValid(NPC_Station)) NPC_Stations.Add(NPC_Station);