Skip to content

Commit

Permalink
fix MovingBlocks#617 (ii): Added Health component to the created rubble
Browse files Browse the repository at this point in the history
  • Loading branch information
Mystic-Slice committed Mar 1, 2022
1 parent 62b07db commit f06afae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import org.destinationsol.assets.Assets;
import org.destinationsol.asteroids.components.AsteroidMesh;
import org.destinationsol.body.components.BodyLinked;
import org.destinationsol.common.In;
import org.destinationsol.common.SolMath;
Expand All @@ -32,6 +33,7 @@
import org.destinationsol.location.components.Angle;
import org.destinationsol.location.components.Position;
import org.destinationsol.location.components.Velocity;
import org.destinationsol.moneyDropping.components.DropsMoneyOnDestruction;
import org.destinationsol.removal.events.DeletionEvent;
import org.destinationsol.removal.systems.DestructionSystem;
import org.destinationsol.rendering.RenderableElement;
Expand Down Expand Up @@ -145,7 +147,8 @@ private void buildRubblePieces(Position pos, Velocity vel, Angle angle, Size siz
velocityComponent.velocity = velocity;

EntityRef entityRef = entitySystemManager.getEntityManager().createEntity(graphicsComponent, positionComponent,
velocityComponent, angle, sizeComponent, new RubbleMesh());
sizeComponent, angle, velocityComponent, new RubbleMesh(), health);

SolMath.free(velocity);
entityRef.setComponent(new BodyLinked());
}
Expand Down

0 comments on commit f06afae

Please sign in to comment.