MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MarkDirty

Method MarkDirty

src/train_cmd.cpp:2999–3010  ·  view source on GitHub ↗

Goods at the consist have changed, update the graphics, cargo, and acceleration. */

Source from the content-addressed store, hash-verified

2997
2998/** Goods at the consist have changed, update the graphics, cargo, and acceleration. */
2999void Train::MarkDirty()
3000{
3001 Train *v = this;
3002 do {
3003 v->colourmap = PAL_NONE;
3004 v->UpdateViewport(true, false);
3005 } while ((v = v->Next()) != nullptr);
3006
3007 /* need to update acceleration and cached values since the goods on the train changed. */
3008 this->CargoChanged();
3009 this->UpdateAcceleration();
3010}
3011
3012/**
3013 * This function looks at the vehicle and updates its speed (cur_speed

Callers 1

CmdMoveRailVehicleFunction · 0.45

Calls 4

UpdateAccelerationMethod · 0.95
CargoChangedMethod · 0.80
UpdateViewportMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected