diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index c5c3b84e..f418982f 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:8f9af32c236df4b8a88ba167bd07764871f97e4bca76049e7ae26f08d2754537 +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 83d82b0e..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:ff388bbb8d32a219946dbbb9c8b98e070271354c6fc234dd0dcdb06b308ac635 -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 79eb097f..ad8069e6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/NPC/NPC_Manager.cpp @@ -37,30 +37,19 @@ 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); - } + int StationClassIndex = 0; for (FVector StationPoint : StationPoints) { - 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); + ANPC_Station* NPC_Station = GetWorld()->SpawnActor(NPC_StationClasses[StationClassIndex], StationPointWorldLocation, DefaultRot); if (IsValid(NPC_Station)) NPC_Stations.Add(NPC_Station); + StationClassIndex++; + if (StationClassIndex >= NPC_StationClasses.Num()) + { + StationClassIndex = 0; + } } SetActorTickInterval(1); }