zengm-games / zengm

Basketball GM (and other ZenGM games) are single-player sports management simulation games, made entirely in client-side JavaScript.
https://zengm.com
Other
361 stars 131 forks source link

Penalties on the extra points of fourth down TDs cause an errant turnover on downs #396

Closed MineRobber9000 closed 2 years ago

MineRobber9000 commented 2 years ago

The following occurred to someone in the Discord, and after poring through the source code, I've figured out what occurred.

The solution, as far as I can tell, could be as simple as adding a check to checkDownAtEndOfPlay to return early if we're in an extra point try. (Or, extra points could be treated like two point conversions, where penalties are just ignored.)

TL;DR: Due to how the game handles downs and advancing them, a penalty on the extra point after a touchdown that is scored on a team's 4th down will cause the game to turn the ball over on downs, make the team that was just scored on kick the extra point, and then make them kick the ball to the team that just scored on them.

dumbmatter commented 2 years ago

The solution, as far as I can tell, could be as simple as adding a check to checkDownAtEndOfPlay to return early if we're in an extra point try.

Absolutely right. Thanks so much!