void HandleLightStateChanged() { LightSwitch lightSwitch = LevelManager.CurrentLevel.LightSourceMap[LightSource]; if (lightSwitch != null) { if (!IsLightActive && LightSource != '-') { if (!detectingMainPlayer) { CurrentPatrolPathDestinationIndex--; } lightSwitch.Interact(this); } else if (Target as AbstractGameObject == lightSwitch) { VisitNextPatrolPathDestination(); } } }