I found the problem so my last post can be neglected.
It turns out the problem was getting objects near the boundaries
(i.e. negative values for x and/or y). My code lookes like...
int deltaX,deltaY;
for(deltaX=-1;deltaX<=1;deltaX++)
for(deltaY=-1;deltaY<=1;deltaY++)
if((deltaX!=0)||(deltaY!=0))
if([world getObjectAtX: xPos+deltaX Y: yPos+deltaY]!= nil){
printf("x: %d y: %d\n",xPos+deltaX,yPos+deltaY);
xprint([world getObjectAtX: xPos+deltaX Y: yPos+deltaY]);
My code would crash at the last line above (the xprint statement).
I was wondering if x=-1 (for example) why does [world getObjectAtX:
xPos+deltaX Y: yPos+deltaY]
return a non-nil value?
This is a hack of heatbugs, so world is a Grid2d object and the space
contains modified heatbugs.
Thanks,
Alex.
_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support