| 298 | } |
| 299 | |
| 300 | void AWeapon::Fire(const FVector& HitTarget) |
| 301 | { |
| 302 | if (FireAnimation) |
| 303 | { |
| 304 | WeaponMesh->PlayAnimation(FireAnimation, false); |
| 305 | } |
| 306 | if (CasingClass) |
| 307 | { |
| 308 | const USkeletalMeshSocket* AmmoEjectSocket = WeaponMesh->GetSocketByName(FName("AmmoEject")); |
| 309 | if (AmmoEjectSocket) |
| 310 | { |
| 311 | FTransform SocketTransform = AmmoEjectSocket->GetSocketTransform(WeaponMesh); |
| 312 | |
| 313 | UWorld* World = GetWorld(); |
| 314 | if (World) |
| 315 | { |
| 316 | World->SpawnActor<ACasing>( |
| 317 | CasingClass, |
| 318 | SocketTransform.GetLocation(), |
| 319 | SocketTransform.GetRotation().Rotator() |
| 320 | ); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | SpendRound(); |
| 325 | } |
| 326 | |
| 327 | void AWeapon::Dropped() |
| 328 | { |
nothing calls this directly
no outgoing calls
no test coverage detected