Skip to content

Commit

Permalink
Fixed incorrect globals interface and related code (fixes christmas e…
Browse files Browse the repository at this point in the history
…rror)
  • Loading branch information
Chomp committed Jan 17, 2025
1 parent f07ba3f commit de00ac3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion project/src/callbacks/DataCallbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class DataCallbacks {
*/
public getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals> {
const globals = this.databaseService.getGlobals();
globals.time = Date.now() / 1000;

return this.httpResponse.getBody(this.databaseService.getGlobals());
}
Expand Down
1 change: 1 addition & 0 deletions project/src/controllers/PrestigeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class PrestigeController {
}

// Skill copy
// TODO - Find what skills should be prestiged over
const commonSKillsToCopy = prePrestigePmc.Skills.Common;
for (const skillToCopy of commonSKillsToCopy) {
// Set progress to max level 20
Expand Down
3 changes: 1 addition & 2 deletions project/src/models/eft/common/IGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import type { Ixy, Ixyz } from "@spt/models/eft/common/Ixyz";
import type { IItem } from "@spt/models/eft/common/tables/IItem";

export interface IGlobals {
time: number;
config: IConfig;
LocationInfection: ILocationInfection;
bot_presets: IBotPreset[];
AudioSettings: IAudioSettings;
BotWeaponScatterings: IBotWeaponScattering[];
ItemPresets: Record<string, IPreset>;
}
Expand Down Expand Up @@ -127,6 +125,7 @@ export interface IProjectileExplosionParams {
}

export interface IConfig {
AudioSettings: IAudioSettings;
ArtilleryShelling: IArtilleryShelling;
content: IContent;
AimPunchMagnitude: number;
Expand Down
2 changes: 1 addition & 1 deletion project/src/services/SeasonalEventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ export class SeasonalEventService {
const globals = this.databaseService.getGlobals();
globals.config.Airdrop.AirdropViewType = "NewYear";

const radioSettings = globals.AudioSettings.RadioBroadcastSettings;
const radioSettings = globals.config.AudioSettings.RadioBroadcastSettings;

radioSettings.EnabledBroadcast = true;
const christmasStation = radioSettings.RadioStations.find((x) => x.Station === "Christmas");
Expand Down

0 comments on commit de00ac3

Please sign in to comment.