{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigqnh7r7yo6l3f5wmeoyv343y5r5joi4azx3xajsk2p3mftoxuuni",
    "uri": "at://did:plc:pvz7ox4x2ehjiezsahttqyyz/app.bsky.feed.post/3mf27tslq6za2"
  },
  "path": "/viewtopic.php?p=449610#p449610",
  "publishedAt": "2026-02-17T03:12:00.000Z",
  "site": "https://forum.luanti.org",
  "tags": [
    "Slightly"
  ],
  "textContent": ">\n> This bug is very old (I think it traces to the very beginning). I have never investigated since it didn’t bother me so much, but it is one of two causes:\n>\n> 1. when the wagon stops, its acceleration is not set to 0 until next time the 2-second force update timer elapses (bug in advtrains wagons.lua)\n> 2. the code sets the acceleration to 0 correctly, but a bug in the Luanti engine causes it to not take effect.\n\nI tested a bunch of stuff with ATC and acceleration and waiting ticks that didn't seem to get me anywhere, but since the train always gave this little bounce and drift when stopping at a stoprail, I looked at braking. My theory now is that it's because after braking, when ATC sends a delay, velocity is not really 0, so the train bounces and sometimes creeps in the opposite direction.\n\nI added a full stop to the end of 4a in train_step_b and it seems better. It was intermittent so still watching to see if it happens again, but it stops without that bounce and drift now so fingers crossed it works for good and I didn't break something else. I'll move it into my sc_advtrains_patches mod and keep testing.\n\n\nCode:\n\n\n    --- 4a. if accelerating, modify the velocity AFTER the movementif accelerating then...end-- sc full stop to prevent bouncing and ghostly reversing during delays if (train.tarvelocity and train.tarvelocity == 0) or (train.atc_delay and train.atc_delay > 0) or train.atc_wait_finish or train.atc_wait_autocouple or train.atc_wait_signal then train.velocity = 0 train.acceleration = 0 endend\n\nStatistics: Posted by Slightly — Tue Feb 17, 2026 03:12\n\n* * *",
  "title": "Mod Releases • Re: [Mod] Advanced Trains [advtrains] [2.8.0]",
  "updatedAt": "2026-02-17T03:12:00.000Z"
}