disallow negative indices for SwitchNode

This commit is contained in:
David Rose 2011-08-16 13:39:13 +00:00
parent a8519d5f0b
commit 4603b5f652
2 changed files with 2 additions and 0 deletions

View File

@ -46,5 +46,6 @@ SelectiveChildNode(const SelectiveChildNode &copy) :
////////////////////////////////////////////////////////////////////
INLINE void SelectiveChildNode::
select_child(int n) {
nassertv(n >= 0);
_selected_child = n;
}

View File

@ -54,6 +54,7 @@ SwitchNode(const string &name) :
////////////////////////////////////////////////////////////////////
INLINE void SwitchNode::
set_visible_child(int index) {
nassertv(index >= 0);
CDWriter cdata(_cycler);
cdata->_visible_child = index;
}