This commit is contained in:
Kingsmedia 2022-05-12 01:43:28 +02:00
parent e4cfe6fa6c
commit c4de187ebb
3 changed files with 7 additions and 17 deletions

View File

@ -2,11 +2,11 @@
#include "BlasterAnimInstance.h" #include "BlasterAnimInstance.h"
#include "BlasterCharacter.h" #include "BlasterCharacter.h"
#include "Blaster/Weapon/Weapon.h"
#include "GameFramework/CharacterMovementComponent.h" #include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/KismetMathLibrary.h" #include "Kismet/KismetMathLibrary.h"
#include "Blaster/Weapon/Weapon.h"
#include "Blaster/Types/CombatState.h"
void UBlasterAnimInstance::NativeInitializeAnimation() void UBlasterAnimInstance::NativeInitializeAnimation()
{ {

View File

@ -108,8 +108,6 @@ void ABlasterCharacter::MulticastEliminated_Implementation()
StartDissolve(); StartDissolve();
// Disable character movement // Disable character movement
GetCharacterMovement()->DisableMovement();
GetCharacterMovement()->StopMovementImmediately();
bDisableGameplay = true; bDisableGameplay = true;
// Disable collision // Disable collision
GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::NoCollision); GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::NoCollision);
@ -153,7 +151,10 @@ void ABlasterCharacter::Destroyed()
{ {
EliminationBotComponent->DestroyComponent(); EliminationBotComponent->DestroyComponent();
} }
if (Combat && Combat->EquippedWeapon)
ABlasterGameMode* BlasterGameMode = Cast<ABlasterGameMode>(UGameplayStatics::GetGameMode(this));
bool bMatchNotInProgress = BlasterGameMode && BlasterGameMode->GetMatchState() != MatchState::InProgress;
if (Combat && Combat->EquippedWeapon && bMatchNotInProgress)
{ {
Combat->EquippedWeapon->Destroy(); Combat->EquippedWeapon->Destroy();
} }

View File

@ -268,18 +268,7 @@ void ABlasterPlayerController::SetHUDTime()
if (MatchState == MatchState::WaitingToStart) TimeLeft = WarmupTime - GetServerTime() + LevelStartingTime; if (MatchState == MatchState::WaitingToStart) TimeLeft = WarmupTime - GetServerTime() + LevelStartingTime;
else if (MatchState == MatchState::InProgress) TimeLeft = WarmupTime + MatchTime - GetServerTime() + LevelStartingTime; else if (MatchState == MatchState::InProgress) TimeLeft = WarmupTime + MatchTime - GetServerTime() + LevelStartingTime;
else if (MatchState == MatchState::Cooldown) TimeLeft = CooldownTime + WarmupTime + MatchTime - GetServerTime() + LevelStartingTime; else if (MatchState == MatchState::Cooldown) TimeLeft = CooldownTime + WarmupTime + MatchTime - GetServerTime() + LevelStartingTime;
uint32 SecondsLeft = FMath::CeilToInt(TimeLeft); uint32 SecondsLeft = FMath::CeilToInt(TimeLeft);
if (HasAuthority())
{
BlasterGameMode = BlasterGameMode == nullptr ? Cast<ABlasterGameMode>(UGameplayStatics::GetGameMode(this)) : BlasterGameMode;
if (BlasterGameMode)
{
SecondsLeft = FMath::CeilToInt(BlasterGameMode->GetCountdownTime() + LevelStartingTime);
}
}
if (CountdownInt != SecondsLeft) if (CountdownInt != SecondsLeft)
{ {
if (MatchState == MatchState::WaitingToStart || MatchState == MatchState::Cooldown) if (MatchState == MatchState::WaitingToStart || MatchState == MatchState::Cooldown)
@ -379,7 +368,7 @@ void ABlasterPlayerController::HandleMatchHasStarted()
BlasterHUD = BlasterHUD == nullptr ? Cast<ABlasterHUD>(GetHUD()) : BlasterHUD; BlasterHUD = BlasterHUD == nullptr ? Cast<ABlasterHUD>(GetHUD()) : BlasterHUD;
if (BlasterHUD) if (BlasterHUD)
{ {
BlasterHUD->AddCharacterOverlay(); if (BlasterHUD->CharacterOverlay == nullptr) BlasterHUD->AddCharacterOverlay();
if (BlasterHUD->Announcement) if (BlasterHUD->Announcement)
{ {
BlasterHUD->Announcement->SetVisibility(ESlateVisibility::Hidden); BlasterHUD->Announcement->SetVisibility(ESlateVisibility::Hidden);