Fix T41778: Crash on animate boids xith a goal

No need to copy/restore entire object struct (just to read location)
This commit is contained in:
Campbell Barton 2014-09-11 12:49:46 +10:00
parent bae66459df
commit 7aedfd654b

@ -630,8 +630,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
}
else {
/* use center of object for distance calculus */
Object *ob = eff->ob;
Object obcopy = *ob;
const Object *ob = eff->ob;
/* use z-axis as normal*/
normalize_v3_v3(efd->nor, ob->obmat[2]);
@ -654,8 +653,6 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
if (real_velocity)
copy_v3_v3(efd->vel, eff->velocity);
*eff->ob = obcopy;
efd->size = 0.0f;
ret = 1;