@quake2ts/game 0.0.780 → 0.0.781

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -7279,7 +7279,8 @@ function setPlayerAttackAnim(player) {
7279
7279
  }
7280
7280
  function checkAmmo(game, player, ammoType, count) {
7281
7281
  if (!player.client) return false;
7282
- if (player.client.inventory.ammo.counts[ammoType] < count) {
7282
+ const ammoCount = player.client.inventory.ammo.counts[ammoType];
7283
+ if (ammoCount === void 0 || ammoCount < count) {
7283
7284
  game.sound(player, 0, "weapons/noammo.wav", 1, ATTN_NORM$1, 0);
7284
7285
  NoAmmoWeaponChange(player);
7285
7286
  return false;
@@ -25342,16 +25343,18 @@ function createGame(imports, engine, options) {
25342
25343
  });
25343
25344
  const linkentity = imports.linkentity;
25344
25345
  const wrappedLinkEntity = (ent) => {
25345
- ent.absmin = {
25346
- x: ent.origin.x + ent.mins.x,
25347
- y: ent.origin.y + ent.mins.y,
25348
- z: ent.origin.z + ent.mins.z
25349
- };
25350
- ent.absmax = {
25351
- x: ent.origin.x + ent.maxs.x,
25352
- y: ent.origin.y + ent.maxs.y,
25353
- z: ent.origin.z + ent.maxs.z
25354
- };
25346
+ if (ent.mins && ent.maxs && ent.origin) {
25347
+ ent.absmin = {
25348
+ x: ent.origin.x + ent.mins.x,
25349
+ y: ent.origin.y + ent.mins.y,
25350
+ z: ent.origin.z + ent.mins.z
25351
+ };
25352
+ ent.absmax = {
25353
+ x: ent.origin.x + ent.maxs.x,
25354
+ y: ent.origin.y + ent.maxs.y,
25355
+ z: ent.origin.z + ent.maxs.z
25356
+ };
25357
+ }
25355
25358
  if (linkentity) {
25356
25359
  linkentity(ent);
25357
25360
  }