Skip to content

Commit

Permalink
Fix some things about the Trigger internal logic
Browse files Browse the repository at this point in the history
This fixes #176.
  • Loading branch information
TheRamenChef committed Nov 24, 2018
1 parent ca5947d commit bb0f0ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/de/gurkenlabs/litiengine/entities/Trigger.java
Expand Up @@ -263,7 +263,6 @@ private boolean activate(final IEntity activator, final int tar) {
return false;
}

this.isActivated = true;
List<Integer> triggerTargets = this.getTargets(tar);

final TriggerEvent te = new TriggerEvent(this, activator, triggerTargets);
Expand All @@ -272,6 +271,8 @@ private boolean activate(final IEntity activator, final int tar) {
return false;
}

this.isActivated = true;

// if we actually have a trigger target, we send the message to the target
if (!triggerTargets.isEmpty()) {
for (final int target : triggerTargets) {
Expand Down Expand Up @@ -315,7 +316,7 @@ private boolean checkActivationPredicates(TriggerEvent te) {
private List<IEntity> getEntitiesInCollisionBox() {
final List<IEntity> collEntities = new CopyOnWriteArrayList<>();
for (final ICollisionEntity coll : Game.getPhysicsEngine().getCollisionEntities()) {
if (!this.activators.isEmpty() && !this.activators.contains(coll.getMapId())) {
if (coll == this || !this.activators.isEmpty() && !this.activators.contains(coll.getMapId())) {
continue;
}

Expand Down

0 comments on commit bb0f0ab

Please sign in to comment.