Commit 86a3c29
authored
fix: prevent task flood caused by double OTSYS_TIME() subtraction in action delay (#3591)
Fixes a bug where `Game::playerEquipItem` incorrectly subtracted
`OTSYS_TIME()` from a delay that had already been normalized inside
`Player::getNextActionTime()`.
This caused negative or extremely large delay values (up to ~28 days),
which led to the Dispatcher scheduling massive amounts of future tasks
that would never execute.
Over time, this behavior caused exponential growth in the
`Dispatcher::scheduledTasks` queue, consuming memory and degrading
server performance.1 parent 1173f95 commit 86a3c29
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3422 | 3422 | | |
3423 | 3423 | | |
3424 | 3424 | | |
3425 | | - | |
| 3425 | + | |
3426 | 3426 | | |
3427 | 3427 | | |
3428 | 3428 | | |
| |||
0 commit comments