Merge branch 'sdk' into online

This commit is contained in:
hahwu 2026-03-30 20:00:52 +08:00
commit 246352ad36
2 changed files with 5 additions and 5 deletions

View File

@ -341,9 +341,9 @@ func (p *Player) handle(m *msg.Msg) error {
BaseMod := p.PlayMod.getBaseMod()
starNum := BaseMod.GetStar()
m.Item[0].Num = min(m.Item[0].Num, starNum)
if 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].Id), m.SendT)
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

@ -860,6 +860,7 @@ func (p *PlayroomMod) FlipCard(pos int) (int, error) {
func (p *PlayroomMod) GetFlipReward() ([]*item.Item, int, int, error) {
check := make(map[int]int)
var items []*item.Item
target := p.Target
result := FLIP_TYPE_COPPER
for _, v := range p.Flip {
check[v]++
@ -881,11 +882,10 @@ func (p *PlayroomMod) GetFlipReward() ([]*item.Item, int, int, error) {
p.LastFlip = v
p.Flip = make(map[int]int)
p.ResetGame()
return items, 0, result, nil
return items, target, result, nil
}
}
return items, p.Target, result, fmt.Errorf("GetFlipReward check is not 3")
return items, target, result, fmt.Errorf("GetFlipReward check is not 3")
}
func (p *PlayroomMod) BuyItem(id int) ([]*item.Item, []*item.Item) {