diff options
author | Melanie | 2011-01-13 00:19:39 +0100 |
---|---|---|
committer | Melanie | 2011-01-13 00:19:39 +0100 |
commit | e4bb8dc3859c49811c0a7b70ada5dcce79094923 (patch) | |
tree | d65a8c0cdbbc3cd640b9e868604e6f63685a5c97 /OpenSim/Framework | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-e4bb8dc3859c49811c0a7b70ada5dcce79094923.zip opensim-SC-e4bb8dc3859c49811c0a7b70ada5dcce79094923.tar.gz opensim-SC-e4bb8dc3859c49811c0a7b70ada5dcce79094923.tar.bz2 opensim-SC-e4bb8dc3859c49811c0a7b70ada5dcce79094923.tar.xz |
Guard against invalid light color specifiers from the database
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 20b9cf1..9a38f23 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -708,7 +708,12 @@ namespace OpenSim.Framework | |||
708 | return _lightColorR; | 708 | return _lightColorR; |
709 | } | 709 | } |
710 | set { | 710 | set { |
711 | _lightColorR = value; | 711 | if (value < 0) |
712 | _lightColorR = 0; | ||
713 | else if (value > 1.0f) | ||
714 | _lightColorR = 1.0f; | ||
715 | else | ||
716 | _lightColorR = value; | ||
712 | } | 717 | } |
713 | } | 718 | } |
714 | 719 | ||
@@ -717,7 +722,12 @@ namespace OpenSim.Framework | |||
717 | return _lightColorG; | 722 | return _lightColorG; |
718 | } | 723 | } |
719 | set { | 724 | set { |
720 | _lightColorG = value; | 725 | if (value < 0) |
726 | _lightColorG = 0; | ||
727 | else if (value > 1.0f) | ||
728 | _lightColorG = 1.0f; | ||
729 | else | ||
730 | _lightColorG = value; | ||
721 | } | 731 | } |
722 | } | 732 | } |
723 | 733 | ||
@@ -726,7 +736,12 @@ namespace OpenSim.Framework | |||
726 | return _lightColorB; | 736 | return _lightColorB; |
727 | } | 737 | } |
728 | set { | 738 | set { |
729 | _lightColorB = value; | 739 | if (value < 0) |
740 | _lightColorB = 0; | ||
741 | else if (value > 1.0f) | ||
742 | _lightColorB = 1.0f; | ||
743 | else | ||
744 | _lightColorB = value; | ||
730 | } | 745 | } |
731 | } | 746 | } |
732 | 747 | ||
@@ -735,7 +750,12 @@ namespace OpenSim.Framework | |||
735 | return _lightColorA; | 750 | return _lightColorA; |
736 | } | 751 | } |
737 | set { | 752 | set { |
738 | _lightColorA = value; | 753 | if (value < 0) |
754 | _lightColorA = 0; | ||
755 | else if (value > 1.0f) | ||
756 | _lightColorA = 1.0f; | ||
757 | else | ||
758 | _lightColorA = value; | ||
739 | } | 759 | } |
740 | } | 760 | } |
741 | 761 | ||