morfidon 2 weeks ago committed by GitHub
parent
commit
ef3a41ed3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      Source/items.cpp

8
Source/items.cpp

@ -2540,7 +2540,13 @@ void CalcPlrLightRadius(Player &player, int lrad)
{
lrad = std::clamp(lrad, 2, 15);
if (player._pLightRad != lrad) {
const bool playerOnActiveLevel = player.isOnActiveLevel();
const bool visionRadiusOutOfSync = playerOnActiveLevel && VisionList[player.getId()].radius != lrad;
const bool lightRadiusOutOfSync = playerOnActiveLevel
&& player.lightId != NO_LIGHT
&& Lights[player.lightId].radius != lrad;
if (player._pLightRad != lrad || visionRadiusOutOfSync || lightRadiusOutOfSync) {
ChangeLightRadius(player.lightId, lrad);
ChangeVisionRadius(player.getId(), lrad);
player._pLightRad = lrad;

Loading…
Cancel
Save