MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / IsLightVisible

Function IsLightVisible

Source/objects.cpp:1555–1575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1553}
1554
1555bool IsLightVisible(Object &light, int lightRadius)
1556{
1557#ifdef _DEBUG
1558 if (DisableLighting)
1559 return false;
1560#endif
1561
1562 for (const Player &player : Players) {
1563 if (!player.plractive)
1564 continue;
1565
1566 if (!player.isOnActiveLevel())
1567 continue;
1568
1569 if (player.position.tile.WalkingDistance(light.position) < lightRadius + 10) {
1570 return true;
1571 }
1572 }
1573
1574 return false;
1575}
1576
1577void UpdateObjectLight(Object &light, int lightRadius)
1578{

Callers 1

UpdateObjectLightFunction · 0.85

Calls 2

isOnActiveLevelMethod · 0.80
WalkingDistanceMethod · 0.80

Tested by

no test coverage detected