mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-01-17 13:40:27 +00:00
fix: update self-kill logic in yearly report analyzer
This commit is contained in:
parent
b62c603b01
commit
c5f54e04b5
@ -386,16 +386,19 @@ class YearlyReportAnalyzer {
|
|||||||
stats._lastDeathTime != null && lineTime.difference(stats._lastDeathTime!).abs().inSeconds <= 2;
|
stats._lastDeathTime != null && lineTime.difference(stats._lastDeathTime!).abs().inSeconds <= 2;
|
||||||
|
|
||||||
// 检测自杀
|
// 检测自杀
|
||||||
|
// 自杀逻辑:selfKillCount 独立统计自杀次数
|
||||||
|
// deathCount 包含所有死亡(普通死亡+自杀),因此自杀时不再从 deathCount 回退
|
||||||
if (victimId == killerId) {
|
if (victimId == killerId) {
|
||||||
if (victimId == stats.currentPlayerName) {
|
if (victimId == stats.currentPlayerName) {
|
||||||
if (isRecent) {
|
if (isRecent) {
|
||||||
// 如果最近已经记录过一次死亡 (可能是通用格式记录的),则修正为自杀
|
// 如果最近已经记录过一次死亡 (通用格式记录的),说明已经在 deathCount 中计入
|
||||||
// 假设通用格式默认为 deathCount++,这里回退并加到 selfKillCount
|
// 只需额外标记为自杀
|
||||||
if (stats.deathCount > 0) stats.deathCount--;
|
|
||||||
stats.selfKillCount++;
|
stats.selfKillCount++;
|
||||||
// 更新时间以保持锁定
|
// 更新时间以保持锁定
|
||||||
stats._lastDeathTime = lineTime;
|
stats._lastDeathTime = lineTime;
|
||||||
} else {
|
} else {
|
||||||
|
// 没有被新版格式记录过,需要同时计入 deathCount 和 selfKillCount
|
||||||
|
stats.deathCount++;
|
||||||
stats.selfKillCount++;
|
stats.selfKillCount++;
|
||||||
stats._lastDeathTime = lineTime;
|
stats._lastDeathTime = lineTime;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user