Skip to content

Commit

Permalink
Fix logging of the player who inbounds the ball for tip in situations
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Oct 1, 2024
1 parent 69e60e9 commit c16ceeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Allegedly in a normal league, "X cuts to the rim as X lobs up the inbound pass" can have the same player as both X https://discord.com/channels/290013534023057409/290015591216054273/1272784016067792910
- https://mail.google.com/mail/u/0/#inbox/FMfcgzQVxtrHnKndhJFRszlGPFFNcfDq?compose=CllgCJvkXPwzrnwrPTZWRVdSNsrHqKSDCRhxbqCLgzhrGpkJJzrnmCnDgJbJPqTfvHDJbgSwNWL
- or player not in game and DNP https://old.reddit.com/r/BasketballGM/comments/1fp9otv/am_i_tripping_why_did_my_dnp_injured_player/

best teams option in legends mode
- iterate over teams, compute ovr, drop ones who don't make the top 30 - is this too slow?

Expand Down
8 changes: 5 additions & 3 deletions src/worker/core/GameSim.basketball/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1957,18 +1957,20 @@ class GameSim extends GameSimBase {
let probMissAndFoul;
let type: ShotType;

if (tipInFromOutOfBounds) {
if (tipInFromOutOfBounds && passer !== undefined) {
type = "tipIn";
probMissAndFoul = 0.02;
probMake =
0.05 + this.team[this.o].player[p].compositeRating.shootingAtRim * 0.1;
0.1 + this.team[this.o].player[p].compositeRating.shootingAtRim * 0.1;
probAndOne = 0.01;

const pAst = this.playersOnCourt[this.o][passer];

this.playByPlay.logEvent({
type: "fgaTipIn",
t: this.o,
pid: this.team[this.o].player[p].id,
pidPass: this.team[this.o].player[passer!].id,
pidPass: this.team[this.o].player[pAst].id,
clock: this.t,
});
} else if (putBack) {
Expand Down

0 comments on commit c16ceeb

Please sign in to comment.