MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / findSupport

Method findSupport

game/state/battle/battleitem.cpp:319–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319bool BattleItem::findSupport()
320{
321 auto tile = tileObject->getOwningTile();
322 auto obj = tile->getItemSupportingObject();
323 if (!obj)
324 {
325 return false;
326 }
327 auto restingPosition =
328 obj->getPosition() + Vec3<float>{0.0f, 0.0f, (float)obj->type->height / 40.0f};
329
330 if (position.z > restingPosition.z)
331 {
332 return false;
333 }
334
335 return true;
336}
337
338void BattleItem::tryCollapse()
339{

Callers 1

initialMapPartLinkUpMethod · 0.45

Calls 3

getOwningTileMethod · 0.80
getPositionMethod · 0.45

Tested by

no test coverage detected