avoid double-starting research
This commit is contained in:
parent
5cad6fe7d9
commit
f37e6dc668
@ -18,6 +18,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
||||
} else if (data.Action == "Start") {
|
||||
const recipe = ExportDojoRecipes.research[data.RecipeType!];
|
||||
guild.TechProjects ??= [];
|
||||
if (!guild.TechProjects.find(x => x.ItemType == data.RecipeType)) {
|
||||
guild.TechProjects.push({
|
||||
ItemType: data.RecipeType!,
|
||||
ReqCredits: scaleRequiredCount(recipe.price),
|
||||
@ -27,6 +28,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
||||
})),
|
||||
State: 0
|
||||
});
|
||||
}
|
||||
await guild.save();
|
||||
res.end();
|
||||
} else if (data.Action == "Contribute") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user