Skip to content

Commit 43108fb

Browse files
committed
Additional fixes
1 parent dc39032 commit 43108fb

File tree

8 files changed

+26
-4
lines changed

8 files changed

+26
-4
lines changed

app/Flare/Services/BuildMonsterCacheService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ private function manageMonsters(array $monstersCache): array
214214
->where('game_map_id', $location->game_map_id)
215215
->where('is_raid_monster', false)
216216
->where('is_raid_boss', false)
217+
->whereNull('only_for_location_type')
217218
->get();
218219

219220
$monsters = $this->transformMonsterForLocation(

app/Game/BattleRewardProcessing/Services/BattleRewardService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ private function handleFactionLoyaltyBounty(): void {
228228

229229
$this->character = $this->character->refresh();
230230

231+
event(new FactionLoyaltyUpdate($this->character->user, $this->factionLoyaltyService->getLoyaltyInfoForPlane($this->character)));
232+
231233
return;
232234
}
233235

app/Game/Exploration/Controllers/Api/DelveExplorationController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ public function begin(DelveExplorationRequest $request, Character $character): J
2929
}
3030

3131
if ($character->currentAutomations()
32-
->where('type', AutomationType::DELVE)
33-
->orWhere('type', AutomationType::EXPLORING)
3432
->where('character_id', $character->id)
33+
->where('completed_at', '>', now())
34+
->where(function ($query) {
35+
$query->where('type', AutomationType::DELVE)
36+
->orWhere('type', AutomationType::EXPLORING);
37+
})
3538
->count() > 0
3639
) {
3740
return response()->json([

app/Game/Exploration/Controllers/Api/ExplorationController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ public function begin(ExplorationRequest $request, Character $character): JsonRe
3030
], 422);
3131
}
3232

33-
if ($character->currentAutomations()->where('type', AutomationType::DELVE)->orWhere('type', AutomationType::EXPLORING)->count() > 0) {
33+
if ($character->currentAutomations()
34+
->where('character_id', $character->id)
35+
->where('completed_at', '>', now())
36+
->where(function ($query) {
37+
$query->where('type', AutomationType::DELVE)
38+
->orWhere('type', AutomationType::EXPLORING);
39+
})
40+
->count() > 0) {
3441
return response()->json([
3542
'message' => 'Nope. You already have one in progress.',
3643
], 422);

app/Game/Exploration/Jobs/DelveExploration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,10 @@ private function endAutomation(?CharacterAutomation $automation, ?DelveExplorati
486486

487487
$this->rewardPlayer($character, $delveExploration->refresh());
488488
}
489+
490+
if (is_null($delveExploration) || is_null($automation)) {
491+
$this->character->currentAutomations()->delete();
492+
}
489493
}
490494

491495
/**

app/Game/Exploration/Jobs/Exploration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,11 @@ private function endAutomation(?CharacterAutomation $automation, CharacterCacheD
405405
event(new UpdateCharacterStatus($character));
406406

407407
event(new ExplorationTimeOut($character->user, 0));
408+
409+
return;
408410
}
411+
412+
$this->character->currentAutomations()->delete();
409413
}
410414

411415
/**

app/Game/Kingdoms/Handlers/CapitalCityHandlers/CapitalCityRequestResourcesHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function handleResourceRequests(
6161
]);
6262

6363
$requestData = $this->markRequestsAsRejected($requestData);
64-
$this->messages[] = 'Resource Request Rejected: No kingdom could be found to request the resources for these buildings.';
64+
$this->messages[] = 'Resource Request Rejected: No kingdom could be found to request the resources for these rquests.';
6565

6666
$queue = $this->updateQueueData($queue, $requestData, CapitalCityQueueStatus::REJECTED);
6767

app/Game/Maps/Services/Common/UpdateRaidMonstersForLocation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function updateMonstersList(Character $character, ?Location $location = n
4646

4747
if (! is_null($location)) {
4848
if (! is_null($location->enemy_strength_type)) {
49+
4950
$locationMonsters = Cache::get('monsters')[$location->name];
5051

5152
if (! $hasAccessToPurgatory && ! is_null($character->map->gameMap->only_during_event_type)) {

0 commit comments

Comments
 (0)