Fixed some ->save() statements in progression.

This commit is contained in:
Vari
2024-03-06 18:41:04 +01:00
parent a5823b3e0e
commit 34f40d6dbc
2 changed files with 5 additions and 1 deletions

View File

@@ -152,6 +152,8 @@ public function playerEndOfMatch(PlayerEndOfMatchRequest $request)
}
}
$characterData->save();
foreach ($request->earnedCurrencies as $earnedCurrency) {
switch ($earnedCurrency['currencyName']) {
case 'CurrencyA':
@@ -164,6 +166,7 @@ public function playerEndOfMatch(PlayerEndOfMatchRequest $request)
$playerData->currency_c += $earnedCurrency['amount'];
}
}
$playerData->save();
$this->removeUserFromGame($user, $game);

View File

@@ -92,7 +92,7 @@ public function executeChallengeProgressionBatch(ExecuteChallengeProgressionBatc
if($operation['operationName'] === 'complete')
$this->setChallengeAsCompleted($challengeId, $user);
else
$this->addProgressToChallenge($challengeId, round($operation['operationsData']['value']), $user);
$this->addProgressToChallenge($challengeId, round($operation['operationData']['value']), $user);
$processedChallenges[] = $challengeId;
}
}
@@ -126,6 +126,7 @@ protected function setChallengeAsCompleted(string $challengeId, User $user)
$foundChallenge->playerData()->updateExistingPivot($user->playerData()->id, [
'progress' => $foundChallenge->completion_value,
]);
$foundChallenge->save();
return;
}