Skip to content

Commit fef54f5

Browse files
author
ulismoon (hyeon)
authored
Merge pull request #2698 from planetarium/bugfix/adv-boss/divide-zero
Handle divide by zero issue
2 parents c81505a + 1397da1 commit fef54f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib9c/Helper/AdventureBossHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.Immutable;
4-
using System.Globalization;
54
using System.Linq;
65
using Nekoyume.Module;
76
using Lib9c;
@@ -283,8 +282,9 @@ public static AdventureBossGameData.ClaimableReward CalculateExploreReward(
283282

284283
// calculate ncg reward
285284
var totalNcgReward = (bountyBoard.totalBounty() * 15).DivRem(100, out _);
286-
var myNcgReward = (totalNcgReward * explorer.Score)
287-
.DivRem(exploreBoard.TotalPoint, out _);
285+
var myNcgReward = exploreBoard.TotalPoint == 0
286+
? 0 * totalNcgReward.Currency
287+
: (totalNcgReward * explorer.Score).DivRem(exploreBoard.TotalPoint, out _);
288288

289289
// Only > 0.1 NCG will be rewarded.
290290
if (myNcgReward >= (10 * gold).DivRem(100, out _))

0 commit comments

Comments
 (0)