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

Function BulldozerTick

src/effectvehicle.cpp:286–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284};
285
286static bool BulldozerTick(EffectVehicle *v)
287{
288 v->progress++;
289 if ((v->progress & 7) == 0) {
290 const BulldozerMovement *b = &_bulldozer_movement[v->animation_state];
291
292 v->sprite_cache.sprite_seq.Set(SPR_BULLDOZER_NE + b->image);
293
294 v->x_pos += _inc_by_dir[b->direction].x;
295 v->y_pos += _inc_by_dir[b->direction].y;
296
297 v->animation_substate++;
298 if (v->animation_substate >= b->duration) {
299 v->animation_substate = 0;
300 v->animation_state++;
301 if (v->animation_state == lengthof(_bulldozer_movement)) {
302 delete v;
303 return false;
304 }
305 }
306 v->UpdatePositionAndViewport();
307 }
308
309 return true;
310}
311
312static void BubbleInit(EffectVehicle *v)
313{

Callers

nothing calls this directly

Calls 2

SetMethod · 0.45

Tested by

no test coverage detected