Skip to content

Commit 847189b

Browse files
Byte Wars Build Pipelinedamarindraab
authored andcommitted
Merged in coregame-release-2.18.1 (pull request #430)
Update coregame to 2.18.1 * Update coregame to 2.18.1 Approved-by: Nauval Muhammad Firdaus Approved-by: Damar Inderajati
1 parent 8edb260 commit 847189b

File tree

15 files changed

+244
-199
lines changed

15 files changed

+244
-199
lines changed

Config/DefaultGame.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[/Script/EngineSettings.GeneralProjectSettings]
22
GitHash=38e2bde
33
ProjectID=8DAB8AD246B954A7292553AF4B4F50E5
4-
ProjectVersion=2.18.0
5-
BuildNumber=280
4+
ProjectVersion=2.18.1
5+
BuildNumber=281
66

77
[/Script/CommonInput.CommonInputSettings]
88
InputData=/Game/ByteWars/UI/Input/B_AccelByteWarsCommonInputData.B_AccelByteWarsCommonInputData_C
-1.06 KB
Binary file not shown.
-60.2 KB
Binary file not shown.

Source/AccelByteWars/Core/Actor/AccelByteWarsMissile.cpp

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "Core/Actor/AccelByteWarsMissile.h"
66

7+
#include "AccelByteWarsMissileTrail.h"
78
#include "AccelByteWars/Core/Player/AccelByteWarsPlayerPawn.h"
89
#include "Core/GameModes/AccelByteWarsInGameGameMode.h"
910
#include "Core/GameStates/AccelByteWarsInGameGameState.h"
@@ -61,6 +62,8 @@ void AAccelByteWarsMissile::BeginPlay()
6162

6263
// Setup event for OnOwnerDestroyed (in blueprint)
6364
DestroyActorOnOwnerDestroyed();
65+
66+
SpawnMissileTrail();
6467
}
6568

6669
void AAccelByteWarsMissile::Destroyed()
@@ -241,6 +244,10 @@ void AAccelByteWarsMissile::OnRepNotify_Color()
241244
return;
242245

243246
AccelByteWarsProceduralMesh->UpdateColor(Color);
247+
if (HasAuthority())
248+
{
249+
MissileTrail->Server_SetColor(Color);
250+
}
244251
}
245252

246253
void AAccelByteWarsMissile::OnRepNotify_Velocity()
@@ -516,10 +523,6 @@ void AAccelByteWarsMissile::DecrementPlayerMissileCount()
516523
if (GetOwner() == nullptr)
517524
return;
518525

519-
AAccelByteWarsPlayerPawn* ABPawn = Cast<AAccelByteWarsPlayerPawn>(GetOwner());
520-
if (ABPawn == nullptr)
521-
return;
522-
523526
AAccelByteWarsPlayerController* ABPlayerController = Cast<AAccelByteWarsPlayerController>(GetOwner()->GetInstigatorController());
524527
if (ABPlayerController == nullptr)
525528
return;
@@ -532,8 +535,6 @@ void AAccelByteWarsMissile::DecrementPlayerMissileCount()
532535
return;
533536

534537
ABPlayerState->MissilesFired--;
535-
ABPawn->FiredMissile = nullptr;
536-
ABPawn->MissileTrail = nullptr;
537538
}
538539

539540
void AAccelByteWarsMissile::NotifyShipHitByMissile() const
@@ -588,3 +589,27 @@ void AAccelByteWarsMissile::NotifyShipHitByMissile() const
588589
);
589590
}
590591
}
592+
593+
void AAccelByteWarsMissile::SpawnMissileTrail()
594+
{
595+
if (!HasAuthority())
596+
{
597+
return;
598+
}
599+
600+
FActorSpawnParameters SpawnParameters;
601+
SpawnParameters.Owner = this;
602+
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
603+
604+
MissileTrail = Owner->GetWorld()->SpawnActor<AAccelByteWarsMissileTrail>(
605+
MissileTrailActor,
606+
FTransform(GetActorRotation(), GetActorLocation()),
607+
SpawnParameters);
608+
if (!MissileTrail)
609+
{
610+
return;
611+
}
612+
613+
MissileTrail->SetReplicates(true);
614+
MissileTrail->AttachToActor(this, FAttachmentTransformRules::SnapToTargetIncludingScale);
615+
}

0 commit comments

Comments
 (0)