Author: gentildemon
Date: Fri Jul 17 14:24:22 2009
New Revision: 6187
URL: http://svn.gna.org/viewcvs/wormux?rev=6187&view=rev
Log:
[BUGFIX] Fix invalid conversion from int to unsigned int that may lead to
strange loop behavior in physical engine
In PhysicalObj::ContactPoint, GetX() + m_width - m_test_right was evaluated by
gcc as an unsigned int since m_width and m_test_right are unsigned int. Since
GetX() returns a int and can be negative, evaluting the whole expression as an
unsigned int may result in a strange behavior.
Fix this by making m_width, m_height, m_test_left, m_test_right, m_test_top, and
m_test_bottom become int instead of unsigned int. Value range is then checked
with ASSERT()
Thanks to Ilari to have indirectly pointed this issue.
Modified:
branches/wormux-0.8.5/src/object/physical_obj.cpp
branches/wormux-0.8.5/src/object/physical_obj.h
_______________________________________________
Wormux-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-cvs