Skip to content

Commit

Permalink
Remove Pass that was causing infinite loops when auto actions were se…
Browse files Browse the repository at this point in the history
…t outside of an auction
  • Loading branch information
andrewzwicky committed Jan 11, 2024
1 parent d5e0e80 commit c8777af
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/engine/step/programmer_auction_bid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def activate_program_auction_bid(entity, program)
reason: "Price for #{target.name} exceeded maximum bid")]
end

[Action::Pass.new(entity)]
[]
end

def auto_buy?(_entity, program)
Expand Down
134 changes: 134 additions & 0 deletions public/fixtures/18EU/programmed_actions_infinite_loop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"id": 3,
"description": "",
"user": {
"id": 3,
"name": "carl"
},
"players": [
{
"id": 2,
"name": "bob"
},
{
"id": 1,
"name": "alice"
},
{
"id": 3,
"name": "carl"
}
],
"min_players": 2,
"max_players": 6,
"title": "18EU",
"settings": {
"seed": 2118254336,
"is_async": true,
"unlisted": false,
"auto_routing": false,
"player_order": null,
"optional_rules": []
},
"user_settings": null,
"status": "finished",
"turn": 1,
"round": "Auction Round",
"acting": [
2
],
"result": {
"1": 350,
"2": 450,
"3": 40
},
"actions": [
{
"type": "bid",
"entity": 2,
"entity_type": "player",
"id": 1,
"user": 3,
"created_at": 1704947354,
"minor": "1",
"price": 100
},
{
"type": "pass",
"entity": 1,
"entity_type": "player",
"id": 2,
"user": 3,
"created_at": 1704947356
},
{
"type": "bid",
"entity": 3,
"entity_type": "player",
"id": 3,
"created_at": 1704947363,
"minor": "1",
"price": 410
},
{
"type": "pass",
"entity": 2,
"entity_type": "player",
"id": 4,
"user": 3,
"created_at": 1704947367
},
{
"type": "program_auction_bid",
"entity": 3,
"entity_type": "player",
"id": 5,
"created_at": 1704947375,
"bid_target": "15",
"enable_maximum_bid": false,
"maximum_bid": "100",
"enable_buy_price": true,
"buy_price": "60",
"auto_pass_after": false
},
{
"type": "bid",
"entity": 1,
"entity_type": "player",
"id": 6,
"user": 3,
"created_at": 1704947389,
"minor": "2",
"price": 100
},
{
"type": "pass",
"entity": 2,
"entity_type": "player",
"id": 7,
"user": 3,
"created_at": 1704947367
},
{
"type": "bid",
"entity": 3,
"entity_type": "player",
"id": 6,
"user": 3,
"created_at": 1704947389,
"minor": "4",
"price": 0
},
{
"type": "end_game",
"entity": 2,
"entity_type": "player",
"id": 8,
"created_at": 1704918333
}
],
"loaded": true,
"created_at": 1704901967,
"updated_at": 1704947389,
"finished_at": null
}

0 comments on commit c8777af

Please sign in to comment.