663 {
664 if (!player)
665 return rawType;
666
667
668
669 bool isOpticsOn = (rawType ==
NVTypes.NV_OPTICS_ON || rawType ==
NVTypes.NV_OPTICS_KAZUAR_DAY || rawType ==
NVTypes.NV_OPTICS_KAZUAR_NIGHT || rawType ==
NVTypes.NV_OPTICS_STARLIGHT_DAY || rawType ==
NVTypes.NV_OPTICS_STARLIGHT_NIGHT);
670 bool isGogglesOn = (rawType ==
NVTypes.NV_GOGGLES || rawType ==
NVTypes.NV_GOGGLES_2D);
671 bool isPumpkinOn = (rawType ==
NVTypes.NV_PUMPKIN);
672
673 if (!isOpticsOn && !isGogglesOn && !isPumpkinOn)
674 return rawType;
675
678
679
680
681 if (!underground && !sandstorm)
682 return rawType;
683
684 if (isOpticsOn)
685 {
686 bool isNight = (rawType ==
NVTypes.NV_OPTICS_ON || rawType ==
NVTypes.NV_OPTICS_KAZUAR_NIGHT || rawType ==
NVTypes.NV_OPTICS_STARLIGHT_NIGHT);
687 if (underground && sandstorm)
688 {
689 return NVTypes.NV_OPTICS_UNDERGROUND_SANDSTORM;
690 }
691
692 if (underground)
693 {
694 return NVTypes.NV_OPTICS_UNDERGROUND;
695 }
696
697 if (isNight)
698 return NVTypes.NV_OPTICS_SANDSTORM_NIGHT;
699 return NVTypes.NV_OPTICS_SANDSTORM_DAY;
700 }
701
702 if (isGogglesOn)
703 {
704 if (underground && sandstorm)
705 return NVTypes.NV_GOGGLES_UNDERGROUND_SANDSTORM;
706 if (underground)
707 return NVTypes.NV_GOGGLES_UNDERGROUND;
708 return NVTypes.NV_GOGGLES_SANDSTORM;
709 }
710
711
712 if (underground && sandstorm)
713 return NVTypes.NV_PUMPKIN_UNDERGROUND_SANDSTORM;
714 if (underground)
715 return NVTypes.NV_PUMPKIN_UNDERGROUND;
716 return NVTypes.NV_PUMPKIN_SANDSTORM;
717 }
bool IsSandstormActiveForPlayer(PlayerBase player)
bool IsPlayerUnderground(PlayerBase player)