Skip to content

Commit

Permalink
scene: Don't change target in the middle of attacks (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
BastianBlokland authored Jul 9, 2023
1 parent c8307dc commit 79b0b91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/scene/src/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ ecs_system_define(SceneControllerUpdateSys) {
target->targetOverride = script_get_entity(targetOverride, 0);
}

// Set attack target.
// Set attack target if we are not currently in the middle of firing.
SceneAttackComp* attack = ecs_view_write_t(itr, SceneAttackComp);
if (attack) {
if (attack && !(attack->flags & SceneAttackFlags_Firing)) {
const ScriptVal attackTarget = scene_brain_get(brain, g_brainKeyAttackTarget);
attack->targetEntity = script_get_entity(attackTarget, 0);
scene_brain_set_null(brain, g_brainKeyAttackTarget);
Expand Down

0 comments on commit 79b0b91

Please sign in to comment.