0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

3.10.0-DEV WIP: Fixes #771 - Quest items not appearing on the case of dying after collecting them. Fixes an issue with gulp v5 corrupting pngs. (!403)

See #771 for discussion and bug report. Implementation deletes the specific task's completedCondition so as to allow the item to appear again.

Gulp v5 has a known issue that corrupts pngs when copying or moving them, this turns off encoding for the copying assets part of the build task.
Reference was [this stack post](https://stackoverflow.com/questions/78391263/copying-images-with-gulp-are-corrupted-damaged).

Reviewed-on: SPT/Server#403
Co-authored-by: crustyselenium <crustyselenium@gmail.com>
Co-committed-by: crustyselenium <crustyselenium@gmail.com>
This commit is contained in:
crustyselenium 2024-08-27 22:15:08 +00:00 committed by chomp
parent 2dfee92a4d
commit 0342a0c39c
3 changed files with 32 additions and 1 deletions

View File

@ -122,7 +122,9 @@ const updateBuildProperties = async () => {
*/ */
const copyAssets = () => const copyAssets = () =>
gulp gulp
.src(["assets/**/*.json", "assets/**/*.json5", "assets/**/*.png", "assets/**/*.jpg", "assets/**/*.ico"]) .src(["assets/**/*.json", "assets/**/*.json5", "assets/**/*.png", "assets/**/*.jpg", "assets/**/*.ico"], {
encoding: false,
})
.pipe(gulp.dest(dataDir)); .pipe(gulp.dest(dataDir));
/** /**

View File

@ -1,3 +1,4 @@
import { QuestController } from "@spt/controllers/QuestController";
import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcData } from "@spt/models/eft/common/IPmcData";
@ -10,6 +11,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseService } from "@spt/services/DatabaseService"; import { DatabaseService } from "@spt/services/DatabaseService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { inject, injectable } from "tsyringe"; import { inject, injectable } from "tsyringe";
import { ProfileHelper } from "./ProfileHelper";
import { QuestHelper } from "./QuestHelper";
@injectable() @injectable()
export class InRaidHelper { export class InRaidHelper {
@ -23,6 +26,9 @@ export class InRaidHelper {
@inject("ConfigServer") protected configServer: ConfigServer, @inject("ConfigServer") protected configServer: ConfigServer,
@inject("PrimaryCloner") protected cloner: ICloner, @inject("PrimaryCloner") protected cloner: ICloner,
@inject("DatabaseService") protected databaseService: DatabaseService, @inject("DatabaseService") protected databaseService: DatabaseService,
@inject("QuestController") protected questController: QuestController,
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("QuestHelper") protected questHelper: QuestHelper,
) { ) {
this.lostOnDeathConfig = this.configServer.getConfig(ConfigTypes.LOST_ON_DEATH); this.lostOnDeathConfig = this.configServer.getConfig(ConfigTypes.LOST_ON_DEATH);
this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID); this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID);
@ -149,6 +155,23 @@ export class InRaidHelper {
} }
} }
/**
* Deletes quest conditions from pickup tasks given a list of quest items being carried by a PMC.
* @param carriedQuestItems Items carried by PMC at death, usually gotten from "CarriedQuestItems"
* @param sessionId Current sessionId
* @param pmcProfile Pre-raid profile that is being handled with raid information
*/
public removePickupQuestConditions(carriedQuestItems: string[], sessionId: string, pmcProfile: IPmcData) {
if (carriedQuestItems && this.lostOnDeathConfig.questItems) {
const pmcQuests = this.questController.getClientQuests(sessionId);
const pmcQuestIds = pmcQuests.map((a) => a._id);
for (const item of carriedQuestItems) {
const failedQuestId = this.questHelper.getFindItemConditionByQuestItem(item, pmcQuestIds, pmcQuests);
this.profileHelper.removeQuestConditionFromProfile(pmcProfile, failedQuestId);
}
}
}
/** /**
* Get an array of items from a profile that will be lost on death * Get an array of items from a profile that will be lost on death
* @param pmcProfile Profile to get items from * @param pmcProfile Profile to get items from

View File

@ -472,6 +472,12 @@ export class LocationLifecycleService {
this.healthHelper.updateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead); this.healthHelper.updateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead);
if (isDead) { if (isDead) {
this.inRaidHelper.removePickupQuestConditions(
postRaidProfile.Stats.Eft.CarriedQuestItems,
sessionId,
pmcProfile,
);
this.pmcChatResponseService.sendKillerResponse(sessionId, pmcProfile, postRaidProfile.Stats.Eft.Aggressor); this.pmcChatResponseService.sendKillerResponse(sessionId, pmcProfile, postRaidProfile.Stats.Eft.Aggressor);
this.inRaidHelper.deleteInventory(pmcProfile, sessionId); this.inRaidHelper.deleteInventory(pmcProfile, sessionId);