Skip to content

Commit

Permalink
fix: add layer check to explosions
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Mar 18, 2024
1 parent 552f4c4 commit 498c80d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/src/objects/explosion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class Explosion {
const lineEnd = v2.add(this.pos, v2.rotate(v2.create(this.rad, 0), angle));

for (const obj of objects) {
if (!util.sameLayer(obj.layer, this.layer)) continue;
if (obj.__type === ObjectType.Player || obj.__type === ObjectType.Obstacle || obj.__type === ObjectType.Loot) {
// check if the object hitbox collides with a line from the explosion center to the explosion max distance
const intersection = collider.intersectSegment(obj.collider, this.pos, lineEnd);
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/weaponManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class WeaponManager {
cooldown: 0
});
}
this.weapons[0].type = "m870";
this.weapons[0].type = "usas";
this.weapons[1].type = "mp5";
this.weapons[0].ammo = 30;
this.weapons[1].ammo = 30;
Expand Down

0 comments on commit 498c80d

Please sign in to comment.