ollybh / 18xx

A platform for playing 18xx games online!
https://www.18xx.games
Other
0 stars 0 forks source link

Player can sell presidency to the pool #122

Closed ianwilson156 closed 4 months ago

ianwilson156 commented 4 months ago

In a SR, a player with 3 shares sold two shares to the pool. Note: the 3rd share disappeared!

ollybh commented 4 months ago

That was all sorts of wrong. I'd reused some code which looks like it might have been written for 1862 or 18GB, where you're able to sell a company presidency to the market. This was attempting to sell the player's 40% and 20% shares to the market and receive in exchange 20% share that was already in the market, but there wasn't a 20% share in the market. This wasn't working. I've changed the code to make sure you're not given the option of dumping the presidency into the market, so this shouldn't happen any more. Fixed in commit cc0b599e7.