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

Function orient_engine

plugins/siege-engine.cpp:193–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static void orient_engine(df::building_siegeenginest *bld, df::coord target)
194{
195 int dx = target.x - bld->centerx;
196 int dy = target.y - bld->centery;
197
198 if (abs(dx) > abs(dy))
199 bld->facing = (dx > 0) ?
200 df::building_siegeenginest::Right :
201 df::building_siegeenginest::Left;
202 else
203 bld->facing = (dy > 0) ?
204 df::building_siegeenginest::Down :
205 df::building_siegeenginest::Up;
206}
207
208static bool is_build_complete(df::building *bld)
209{

Callers 2

setTargetAreaFunction · 0.85
aimAtPointMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected