Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Commit

Permalink
fix: fix picking up skins
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Sep 29, 2023
1 parent 2084936 commit 9cfcaf1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/game/objects/loot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Constants, ObjectKind } from "../../utils/constants";
import { deepCopy, log } from "../../utils/misc";
import { Items, LootTables, Weapons, TypeToId } from "../../utils/data";
import { Items, LootTables, Weapons, TypeToId, IdToGameType } from "../../utils/data";
import type { SurvivBitStream } from "../../utils/survivBitStream";
import { random, unitVecToRadians, weightedRandom } from "../../utils/math";
import { type Game } from "../game";
Expand Down Expand Up @@ -110,6 +110,14 @@ export class Loot extends GameObject {
} else if (this.typeString.startsWith("helmet")) {
result = this.pickUpTieredItem("helmet", p);
playerDirty = true;
} else if (this.typeString.startsWith("outfit")) {
if (p.loadout.outfit === this.typeId) {
result = PickupMsgType.AlreadyOwned;
} else {
this.game.dynamicObjects.add(new Loot(this.game, IdToGameType[p.loadout.outfit], this.position, p.layer, 1));
p.loadout.outfit = this.typeId;
playerDirty = true;
}
} else if (Constants.bagSizes[this.typeString]) {
// Throwables implementation [inside here cus it's tiered]
/* if (Weapons[this.typeString]?.type === "throwable") {
Expand Down Expand Up @@ -284,7 +292,7 @@ export class Loot extends GameObject {
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
damage(amount: number, source): void {}
damage(amount: number, source): void { }
}

export interface LooseLoot {
Expand Down

0 comments on commit 9cfcaf1

Please sign in to comment.