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

Method activate

source/traps/Trap.cpp:247–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void Trap::activate(Tile* tile)
248{
249 if (tile == nullptr)
250 return;
251
252 TrapTileData* trapTileData = static_cast<TrapTileData*>(mTileData[tile]);
253 trapTileData->setActivated(true);
254 trapTileData->setNbShootsBeforeDeactivation(mNbShootsBeforeDeactivation);
255 trapTileData->setReloadTime(0);
256
257 BuildingObject* entity = getBuildingObjectFromTile(tile);
258 if (entity == nullptr)
259 return;
260
261 entity->setMeshOpacity(1.0f);
262}
263
264void Trap::deactivate(Tile* tile)
265{

Callers

nothing calls this directly

Calls 4

setActivatedMethod · 0.80
setReloadTimeMethod · 0.80
setMeshOpacityMethod · 0.80

Tested by

no test coverage detected