Ejemplo n.º 1
0
void ASBombActor::OnRep_FuzeActive()
{
	if (bIsFuzeActive && !bExploded)
	{
		SimulateFuzeFX();
	}
}
Ejemplo n.º 2
0
void ASBombActor::OnUsed(APawn* InstigatorPawn)
{
	Super::OnUsed(InstigatorPawn);

	if (!bIsFuzeActive)
	{
		// This will trigger the SimulateFuzeFX() on the clients
		bIsFuzeActive = true;

		// Repnotify does not trigger on the server, so call the function here directly.
		SimulateFuzeFX();

		// Activate the fuze to explode the bomb after several seconds
		GetWorldTimerManager().SetTimer(FuzeTimerHandle, this, &ASBombActor::OnExplode, MaxFuzeTime, false);
	}
}
Ejemplo n.º 3
0
void ASBombActor::OnUsed(APawn* InstigatorPawn)
{
	if (bIsFuzeActive)
	{
		return;
	}

	Super::OnUsed(InstigatorPawn);

	bIsFuzeActive = true;
	// Runs on all clients (NetMulticast)
	SimulateFuzeFX();

	// Activate the fuze to explode the bomb after several seconds
	GetWorldTimerManager().SetTimer(FuzeTimerHandle, this, &ASBombActor::OnExplode, MaxFuzeTime, false);

}