Skip to content

Commit fb4cb54

Browse files
committed
Fix: only use handled crimes for cumulative
1 parent 8f02192 commit fb4cb54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gameserver/event-handler/crime-log-created.handler.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,14 @@ export class CrimeLogCreatedHandler
112112
.andWhere(`pc.created_at >= now() - :cum_interval::interval`, {
113113
cum_interval: cumInterval
114114
}) // interval here
115+
.andWhere({
116+
handled: true
117+
})
115118
.getMany();
116119

117120
// total crimes done within 24 hours
118-
const countedCrimes = countCrimes(frequentCrimesCount);
121+
// We do `+1` because it doesnt count current crime, but we want to
122+
const countedCrimes = countCrimes(frequentCrimesCount) + 1;
119123

120124
let totalPunishmentCount = countedCrimes.get(thisCrime.crime) || 0;
121125
const basePunishment = getBasePunishment(thisCrime.crime);

0 commit comments

Comments
 (0)