Guard against invalid light color specifiers from the database

avinationmerge
Melanie 2011-01-13 00:19:39 +01:00
parent 6a2b947e8c
commit e4bb8dc385
1 changed files with 24 additions and 4 deletions

View File

@ -708,7 +708,12 @@ namespace OpenSim.Framework
return _lightColorR; return _lightColorR;
} }
set { set {
_lightColorR = value; if (value < 0)
_lightColorR = 0;
else if (value > 1.0f)
_lightColorR = 1.0f;
else
_lightColorR = value;
} }
} }
@ -717,7 +722,12 @@ namespace OpenSim.Framework
return _lightColorG; return _lightColorG;
} }
set { set {
_lightColorG = value; if (value < 0)
_lightColorG = 0;
else if (value > 1.0f)
_lightColorG = 1.0f;
else
_lightColorG = value;
} }
} }
@ -726,7 +736,12 @@ namespace OpenSim.Framework
return _lightColorB; return _lightColorB;
} }
set { set {
_lightColorB = value; if (value < 0)
_lightColorB = 0;
else if (value > 1.0f)
_lightColorB = 1.0f;
else
_lightColorB = value;
} }
} }
@ -735,7 +750,12 @@ namespace OpenSim.Framework
return _lightColorA; return _lightColorA;
} }
set { set {
_lightColorA = value; if (value < 0)
_lightColorA = 0;
else if (value > 1.0f)
_lightColorA = 1.0f;
else
_lightColorA = value;
} }
} }