Skip to content

Commit

Permalink
fix: fixed server crash when attacking with shield
Browse files Browse the repository at this point in the history
  • Loading branch information
Picoseconds committed Aug 1, 2020
1 parent debf14e commit fd1b1a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/moomoo/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import GameObject from "../gameobjects/GameObject";
import { PacketType } from "../packets/PacketType";
import FileAsync from 'lowdb/adapters/FileAsync';
import { PacketFactory } from "../packets/PacketFactory";
import { getWeaponDamage, getWeaponAttackDetails, getItemCost, getPlaceable, PrimaryWeapons, getWeaponGatherAmount, getPrerequisiteItem, getGroupID } from "../items/items";
import { getWeaponDamage, getWeaponAttackDetails, getItemCost, getPlaceable, PrimaryWeapons, getWeaponGatherAmount, getPrerequisiteItem, getGroupID, Weapons } from "../items/items";
import { gameObjectSizes, GameObjectType } from "../gameobjects/gameobjects";
import { getUpgrades, getWeaponUpgrades } from './Upgrades';

Expand Down Expand Up @@ -410,7 +410,7 @@ export default class Game {
this.state.players.forEach((player) => {
Physics.movePlayer(player, 33, this.state);

if (player.isAttacking && player.buildItem == -1) {
if (player.isAttacking && player.selectedWeapon != Weapons.Shield && player.buildItem == -1) {
if (Date.now() - player.lastHitTime >= player.getWeaponHitTime()) {
let nearbyPlayers = player.getNearbyPlayers(this.state);

Expand Down

0 comments on commit fd1b1a6

Please sign in to comment.