Skip to content

Commit 5c9bb55

Browse files
committed
fix: victory screen winner text
Victory quotes now follow the actual final hitter (not always the first selected character) in simul/tag. Fixes #2960
1 parent f549a63 commit 5c9bb55

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/motif.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5153,8 +5153,10 @@ func (vi *MotifVictory) clear(m *Motif) {
51535153
vi.clearProps(&m.VictoryScreen.P8)
51545154
}
51555155

5156-
func (vi *MotifVictory) getVictoryQuote(m *Motif) string {
5157-
p := sys.chars[sys.winnerTeam()-1][0]
5156+
func (vi *MotifVictory) getVictoryQuote(m *Motif, p *Char) string {
5157+
if p == nil || p.playerNo < 0 || p.playerNo >= len(sys.cgi) {
5158+
return m.VictoryScreen.WinQuote.Text
5159+
}
51585160
quoteIndex := int(p.winquote)
51595161
playerQuotes := sys.cgi[p.playerNo].quotes
51605162

@@ -5377,7 +5379,11 @@ func (vi *MotifVictory) init(m *Motif) {
53775379
vi.applyEntry(m, lSlots[i], lEntries[i], lNames[i])
53785380
}
53795381

5380-
vi.text = vi.getVictoryQuote(m)
5382+
var leader *Char
5383+
if len(wEntries) > 0 {
5384+
leader = wEntries[0].c
5385+
}
5386+
vi.text = vi.getVictoryQuote(m, leader)
53815387
m.VictoryBgDef.BGDef.Reset()
53825388

53835389
//fmt.Printf("[Victory] init done. Winners=%d entries, Losers=%d entries. WinQuote=%q\n", len(wEntries), len(lEntries), vi.text)

0 commit comments

Comments
 (0)