Prevent gifter bot being added twice

This commit is contained in:
Dev 2024-01-18 12:20:28 +00:00
parent a3e4f6141d
commit c8fa31184f

View File

@ -525,6 +525,12 @@ export class SeasonalEventService
for (const gifterMapSettings of gifterSettings) for (const gifterMapSettings of gifterSettings)
{ {
const mapData: ILocationData = maps[gifterMapSettings.map]; const mapData: ILocationData = maps[gifterMapSettings.map];
// Dont add gifter to map twice
if (mapData.base.BossLocationSpawn.some(boss => boss.BossName === "gifter"))
{
continue;
}
mapData.base.BossLocationSpawn.push({ mapData.base.BossLocationSpawn.push({
BossName: "gifter", BossName: "gifter",
BossChance: gifterMapSettings.spawnChance, BossChance: gifterMapSettings.spawnChance,