diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index 420c73d8..88f04089 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -565,7 +565,9 @@ export class GameController */ public getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse { - const mapBase: ILocationBase = this.databaseServer.getTables().locations[request.Location.toLowerCase()].base; + const db = this.databaseServer.getTables() + + const mapBase: ILocationBase = db.locations[request.Location.toLowerCase()].base; const baseEscapeTimeMinutes = mapBase.EscapeTimeLimit; // Prep result object to return @@ -620,14 +622,11 @@ export class GameController this.logger.debug(`Reduced: ${request.Location} raid time by: ${chosenRaidReductionPercent}% to ${newRaidTimeMinutes} minutes`) - // get our new total raid time as seconds - const newRaidTimeSeconds = newRaidTimeMinutes * 60; - - const originalSurvivalTimeSeconds = this.databaseServer.getTables().globals.config.exp.match_end.survived_seconds_requirement; + const originalSurvivalTimeSeconds = db.globals.config.exp.match_end.survived_seconds_requirement; result.OriginalSurvivalTimeSeconds = originalSurvivalTimeSeconds; // Calculate how long player needs to be in raid to get a `survived` extract status - result.NewSurviveTimeSeconds = Math.max(originalSurvivalTimeSeconds - newRaidTimeSeconds, 0); + result.NewSurviveTimeSeconds = Math.max(originalSurvivalTimeSeconds - ((baseEscapeTimeMinutes - newRaidTimeMinutes) * 60), 0); const exitAdjustments = this.getExitAdjustments(mapBase, newRaidTimeMinutes); if (exitAdjustments)