mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #1395 from Azaezel/AssertDivNULL
credit to @MusicMonkey5555 for spotting. asserts for Div/NULLs
This commit is contained in:
commit
6235f63deb
2 changed files with 3 additions and 0 deletions
|
|
@ -503,6 +503,7 @@ inline ColorI& ColorI::operator*=(const S32 in_mul)
|
||||||
|
|
||||||
inline ColorI& ColorI::operator/=(const S32 in_mul)
|
inline ColorI& ColorI::operator/=(const S32 in_mul)
|
||||||
{
|
{
|
||||||
|
AssertFatal(in_mul != 0.0f, "Error, div by zero...");
|
||||||
red = red / in_mul;
|
red = red / in_mul;
|
||||||
green = green / in_mul;
|
green = green / in_mul;
|
||||||
blue = blue / in_mul;
|
blue = blue / in_mul;
|
||||||
|
|
|
||||||
|
|
@ -438,6 +438,7 @@ inline Point2I Point2I::operator/(const Point2I &_vec) const
|
||||||
|
|
||||||
inline Point2I& Point2I::operator/=(const Point2I &_vec)
|
inline Point2I& Point2I::operator/=(const Point2I &_vec)
|
||||||
{
|
{
|
||||||
|
AssertFatal(_vec.x != 0 && _vec.y != 0, "Error, div by zero attempted");
|
||||||
x /= _vec.x;
|
x /= _vec.x;
|
||||||
y /= _vec.y;
|
y /= _vec.y;
|
||||||
return *this;
|
return *this;
|
||||||
|
|
@ -645,6 +646,7 @@ inline Point2F Point2F::operator/(const Point2F &_vec) const
|
||||||
|
|
||||||
inline Point2F& Point2F::operator/=(const Point2F &_vec)
|
inline Point2F& Point2F::operator/=(const Point2F &_vec)
|
||||||
{
|
{
|
||||||
|
AssertFatal(_vec.x != 0 && _vec.y != 0, "Error, div by zero attempted");
|
||||||
x /= _vec.x;
|
x /= _vec.x;
|
||||||
y /= _vec.y;
|
y /= _vec.y;
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue