Bugfix Targets being Randomized out of Array

This commit is contained in:
Rafal Swierczek 2024-01-14 06:58:13 +00:00
parent 8b96a67028
commit 6a5559adb2
8 changed files with 15 additions and 19 deletions

View File

@ -8,15 +8,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="42162083-13f4-4956-90b7-146c4a08f785" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/Bounty/MB_Training.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/Bounty/MB_Training.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/GunRangeMechanics/BP_DroppableWall.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/GunRangeMechanics/BP_DroppableWall.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/GunRangeMechanics/Target/BP_Target.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/BountySystem/ControlsTutorial/GunRangeMechanics/Target/BP_Target.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/Levels/ControlTutorialLevel.umap" beforeDir="false" afterPath="$PROJECT_DIR$/Content/Levels/ControlTutorialLevel.umap" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Audio/Collapse01.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Audio/Collapse01.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/ShotgunClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/ShotgunClass.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -131,7 +123,7 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1705182847910</updated>
<workItem from="1705182850227" duration="3992000" />
<workItem from="1705182850227" duration="4656000" />
</task>
<servers />
</component>

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5359d34f51cb7298d6e3c64aa6ff60e6a610066339af826e5e53b95436f12be
oid sha256:5f1fb7ff9a560e39c6c7833d79931bcb0cdcba202fcd3f066142ca87a03df911
size 3184727

Binary file not shown.

View File

@ -3,6 +3,7 @@
#include "ShotgunClass.h"
#include "EndlessVendetta/AI/EnemyCharacter.h"
#include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h"
#include "Engine/DamageEvents.h"
AShotgunClass::AShotgunClass()
@ -46,6 +47,7 @@ void AShotgunClass::Fire()
{
tempWeaponDamage = WeaponDamage;
}
if (ATargetDummy* TargetDummy = Cast<ATargetDummy>(outHit.GetActor())) TargetDummy->TargetShot();
if (!Cast<AAICharacter>(outHit.GetActor())) return;
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
}

View File

@ -4,6 +4,7 @@
#include "SniperClass.h"
#include "EndlessVendetta/EndlessVendettaCharacter.h"
#include "EndlessVendetta/AI/AICharacter.h"
#include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h"
#include "Engine/DamageEvents.h"
#include "Kismet/GameplayStatics.h"
@ -66,6 +67,7 @@ void ASniperClass::Fire()
{
tempWeaponDamage = WeaponDamage;
}
if (ATargetDummy* TargetDummy = Cast<ATargetDummy>(outHit.GetActor())) TargetDummy->TargetShot();
if (!Cast<AAICharacter>(outHit.GetActor())) return;
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
}