Skip to content

Commit

Permalink
Support null values when applying a force effect
Browse files Browse the repository at this point in the history
This allows to not create a force instance under certain conditions
  • Loading branch information
steffen-wilke committed Dec 8, 2024
1 parent cb161b3 commit bc7e624
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public void apply(final ICombatEntity affectedEntity) {
super.apply(affectedEntity);
if (affectedEntity instanceof IMobileEntity mobileEntity) {
Force force = createForce(mobileEntity);
if (force == null) {
return;
}

appliedForces.put(mobileEntity, force);
mobileEntity.movement().apply(force);
}
Expand Down

0 comments on commit bc7e624

Please sign in to comment.