MCPcopy Create free account
hub / github.com/DFHack/dfhack / is_wagon_tile_traversible

Function is_wagon_tile_traversible

plugins/pathable.cpp:250–271  ·  view source on GitHub ↗

NOTE: When i.e. tracks, stairs have a bridge over them, the tile will have an occupancy of floored.

Source from the content-addressed store, hash-verified

248// NOTE: When i.e. tracks, stairs have a bridge over them, the tile will have
249// an occupancy of floored.
250static bool is_wagon_tile_traversible(df::tiletype tt) {
251 auto shape = tileShape(tt);
252 auto special = tileSpecial(tt);
253 auto material = tileMaterial(tt);
254
255 // Allow ramps (murky pool and river tiles are blocked except for ramps)
256 if (shape == df::tiletype_shape::RAMP_TOP)
257 return true;
258 // NOTE: smoothing a boulder turns it into a smoothed floor
259 else if (shape == df::tiletype_shape::STAIR_UP || shape == df::tiletype_shape::STAIR_DOWN ||
260 shape == df::tiletype_shape::STAIR_UPDOWN || shape == df::tiletype_shape::BOULDER ||
261 shape == df::tiletype_shape::EMPTY || shape == df::tiletype_shape::NONE)
262 return false;
263 else if (special == df::tiletype_special::TRACK)
264 return false;
265 // Fires seem to have their own path group, and group for lava is 0
266 // According to wiki, the wagon won't path thru pool and river tiles, but ramps are ok
267 else if (material == df::tiletype_material::POOL || material == df::tiletype_material::RIVER)
268 return false;
269
270 return true;
271}
272
273static bool is_wagon_traversible(FloodCtx & ctx, const df::coord & pos, const df::coord & prev_pos) {
274 auto tt = Maps::getTileType(pos);

Callers 1

is_wagon_traversibleFunction · 0.85

Calls 3

tileShapeFunction · 0.85
tileSpecialFunction · 0.85
tileMaterialFunction · 0.85

Tested by

no test coverage detected