Skip to content

Commit

Permalink
fix: fix prerequisite weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
Picoseconds committed Aug 1, 2020
1 parent 0c75a5b commit c2db126
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/items/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ function getPrerequisiteItem(item: ItemType) {
return items[item].pre;
}

function getPrerequisiteWeapon(weapon: Weapons) {
return weapons[weapon].pre;
}

function getPlaceOffset(item: ItemType) {
return items[item].placeOffset;
}
Expand All @@ -147,4 +151,4 @@ function getGameObjID(item: ItemType) {
return 0;
}

export { PrimaryWeapons, SecondaryWeapons, getHitTime, Weapons, getWeaponAttackDetails, getWeaponDamage, getItemCost, getPlaceable, getPlaceOffset, getScale, getGameObjID, getWeaponGatherAmount, getPrerequisiteItem, getGroupID };
export { PrimaryWeapons, SecondaryWeapons, getHitTime, Weapons, getWeaponAttackDetails, getWeaponDamage, getItemCost, getPlaceable, getPlaceOffset, getScale, getGameObjID, getWeaponGatherAmount, getPrerequisiteItem, getGroupID, getPrerequisiteWeapon };
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, Weapons } from "../items/items";
import { getWeaponDamage, getWeaponAttackDetails, getItemCost, getPlaceable, PrimaryWeapons, getWeaponGatherAmount, getPrerequisiteItem, getGroupID, Weapons, getPrerequisiteWeapon } from "../items/items";
import { gameObjectSizes, GameObjectType } from "../gameobjects/gameobjects";
import { getUpgrades, getWeaponUpgrades } from './Upgrades';

Expand Down Expand Up @@ -888,7 +888,7 @@ export default class Game {

if (item <= 15) {
if (weaponUpgrades.includes(item)) {
let preItem = getPrerequisiteItem(item);
let preItem = getPrerequisiteWeapon(item);

if (preItem) {
if (!(client.player.weapon == item - preItem || client.player.secondaryWeapon == item - preItem)) this.kickClient(client, "Kicked for hacks");
Expand Down

0 comments on commit c2db126

Please sign in to comment.