Skip to content
Snippets Groups Projects
Commit 51122636 authored by Tazpn's avatar Tazpn
Browse files

Fix but with SetCollisionObject which does not allow setting the value to nothing.

parent 02f9b7c1
No related branches found
No related tags found
No related merge requests found
...@@ -338,10 +338,12 @@ Ref<NiCollisionObject > NiAVObject::GetCollisionObject() const { ...@@ -338,10 +338,12 @@ Ref<NiCollisionObject > NiAVObject::GetCollisionObject() const {
} }
void NiAVObject::SetCollisionObject( NiCollisionObject * value ) { void NiAVObject::SetCollisionObject( NiCollisionObject * value ) {
if ( value->GetTarget() != NULL ) { if ( value != NULL ) {
throw runtime_error( "You have attempted to add a collision object to a NiAVObject which is already attached to another NiAVObject." ); if ( value->GetTarget() != NULL ) {
throw runtime_error( "You have attempted to add a collision object to a NiAVObject which is already attached to another NiAVObject." );
}
value->SetTarget( this );
} }
value->SetTarget( this );
if ( collisionObject !=NULL ) { if ( collisionObject !=NULL ) {
//Remove unlink previous collision object from this node //Remove unlink previous collision object from this node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment