@zardoy/flying-squid 0.0.116 → 0.0.117
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/lib/modules/pvp.js +4 -2
- package/package.json +1 -1
package/dist/lib/modules/pvp.js
CHANGED
|
@@ -15,10 +15,12 @@ const player = function (player, serv) {
|
|
|
15
15
|
let lastAttackTime = 0;
|
|
16
16
|
function attackEntity(entityId) {
|
|
17
17
|
const attackedEntity = serv.entities[entityId];
|
|
18
|
-
const attackedPlayer = attackedEntity.type === 'player' ? attackedEntity : undefined;
|
|
19
18
|
if (!attackedEntity)
|
|
20
19
|
return;
|
|
21
|
-
|
|
20
|
+
const attackedPlayer = attackedEntity.type === 'player' ? attackedEntity : undefined;
|
|
21
|
+
if (!attackedPlayer)
|
|
22
|
+
return;
|
|
23
|
+
if (attackedPlayer.gameMode === 1 || attackedPlayer.gameMode === 3 || attackedPlayer.invincible)
|
|
22
24
|
return;
|
|
23
25
|
// Anti-cheat: Distance check
|
|
24
26
|
const distance = player.position.distanceTo(attackedEntity.position);
|