破产时间线优化

This commit is contained in:
hahwu 2026-03-30 20:39:43 +08:00
parent 4dbb8de2e9
commit a7b2b39fd2
2 changed files with 7 additions and 2 deletions

View File

@ -343,7 +343,9 @@ func (p *Player) handle(m *msg.Msg) error {
m.Item[0].Num = min(m.Item[0].Num, starNum)
if m.Item[0].Num >= starNum && gameId == playroom.GAME_TYPE_FILP {
bankruptcy = true
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_BANKRUPTCY, fmt.Sprintf("%d", m.Item[0].Num), m.SendT)
if m.Item[0].Num > 0 {
p.AddLog(m.From, friend.LOG_TYPE_PLAYROOM_BANKRUPTCY, fmt.Sprintf("%d", m.Item[0].Num), m.SendT)
}
}
p.HandleLoseItem(m.Item, "HANDLE_TYPE_PLAYROOM_LOSE")
} else {

View File

@ -448,7 +448,7 @@ func (p *PlayroomMod) AddChip(uid int, time int64, emoji int) {
func (p *PlayroomMod) SetTarget(target int) {
p.Target = target
p.Status = 1
p.Status = STATUS_VISIT
p.HasVisit[target] = GoUtil.Now()
}
@ -858,6 +858,9 @@ func (p *PlayroomMod) FlipCard(pos int) (int, error) {
}
func (p *PlayroomMod) GetFlipReward() ([]*item.Item, int, int, error) {
if p.Status != STATUS_VISIT {
return nil, 0, 0, fmt.Errorf("GetFlipReward Status is not STATUS_VISIT")
}
check := make(map[int]int)
var items []*item.Item
target := p.Target