Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7c13 committed Jul 18, 2024
1 parent 8433938 commit 3068652
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -981,19 +981,9 @@ public void Execute(ActorActivateCommand command)
// Manually remove the active actor collider when it is being deactivated by script if any
if (_activeColliders.Count > 0 && command.IsActive == 0)
{
ActiveColliderInfo colliderToBeRemoved = null;

foreach (ActiveColliderInfo colliderInfo in _activeColliders)
{
if (colliderInfo.ColliderGameEntity.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Id == command.ActorId)
{
colliderToBeRemoved = colliderInfo;
break;
}
}

if (colliderToBeRemoved != null) _activeColliders.Remove(colliderToBeRemoved);
_activeColliders.RemoveWhere(
_ => _.ColliderGameEntity.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Id == command.ActorId);
}

// When self is being deactivated, cancel the movement
Expand Down

0 comments on commit 3068652

Please sign in to comment.