fix: track FreeFavorsEarned & FreeFavorsUsed #792
@ -50,6 +50,13 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
|||||||
syndicate.Title ??= 0;
|
syndicate.Title ??= 0;
|
||||||
syndicate.Title += 1;
|
syndicate.Title += 1;
|
||||||
|
|
||||||
|
if (syndicate.Title > 0 && manifest.favours.length != 0) {
|
||||||
|
syndicate.FreeFavorsEarned ??= [];
|
||||||
|
if (!syndicate.FreeFavorsEarned.includes(syndicate.Title)) {
|
||||||
|
syndicate.FreeFavorsEarned.push(syndicate.Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
if (reward) {
|
if (reward) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user
⚠️ Potential issue
Add null check for manifest and type safety
The code needs additional safety checks:
manifest
before accessingfavours
FreeFavorsEarned
Apply this diff to add the necessary checks:
📝 Committable suggestion