MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / isAttackable

Method isAttackable

source/traps/Trap.cpp:410–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410bool Trap::isAttackable(Tile* tile, Seat* seat) const
411{
412 if(!Building::isAttackable(tile, seat))
413 return false;
414
415 // We check if the trap is hidden for this seat
416 auto it = mTileData.find(tile);
417 if(it == mTileData.end())
418 {
419 OD_LOG_ERR("name=" + getName() + ", tile=" + Tile::displayAsString(tile));
420 return false;
421 }
422
423 TrapTileData* trapTileData = static_cast<TrapTileData*>(it->second);
424 if(std::find(trapTileData->mSeatsVision.begin(), trapTileData->mSeatsVision.end(), seat) == trapTileData->mSeatsVision.end())
425 return false;
426
427 return true;
428}
429
430void Trap::restoreInitialEntityState()
431{

Callers 3

handleFightMethod · 0.45
handleFightMethod · 0.45
getVisibleForceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected