ephysics: check for side value on anchors full add

function




SVN revision: 79037
This commit is contained in:
Bruno Dilly 2012-11-09 18:52:16 +00:00
parent 5169b73515
commit 5d465e1c04
2 changed files with 7 additions and 0 deletions

View File

@ -1838,6 +1838,7 @@ typedef enum _EPhysics_Body_Cloth_Anchor_Side
EPHYSICS_BODY_CLOTH_ANCHOR_SIDE_RIGHT,
EPHYSICS_BODY_CLOTH_ANCHOR_SIDE_TOP,
EPHYSICS_BODY_CLOTH_ANCHOR_SIDE_BOTTOM,
EPHYSICS_BODY_CLOTH_ANCHOR_SIDE_LAST,
} EPhysics_Body_Cloth_Anchor_Side;
/**

View File

@ -1484,6 +1484,12 @@ ephysics_body_cloth_anchor_full_add(EPhysics_Body *body1, EPhysics_Body *body2,
return;
}
if ((side < 0) || (side >= EPHYSICS_BODY_CLOTH_ANCHOR_SIDE_LAST))
{
ERR("Could not add anchors, side is invalid.");
return;
}
rows = body1->cloth_rows + 1;
columns = body1->cloth_columns + 1;
anchor_mass = body1->soft_body->m_nodes.size() * 0.025;