feat: no dmg if invulnerable

This commit is contained in:
cha0s 2019-04-19 15:52:54 -05:00
parent c1643180df
commit c9b51d81d9

View File

@ -32,7 +32,7 @@ export class Damaging extends Trait {
const isCollidingWith = this.entity.isCollidingWith;
for (let i = 0; i < isCollidingWith.length; ++i) {
const entity = isCollidingWith[i];
if (entity.is('vulnerable')) {
if (entity.is('vulnerable') && !entity.isInvulnerable) {
entity.takeDamageFrom(this.entity);
}
}