|
From: | Steve Railsback |
Subject: | Re: [Swarm-Support] Segmentation Violation |
Date: | Mon, 25 Oct 2004 17:46:04 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
Alex Olivas wrote:
I modified bug slightly to "interact" with nearest neighbor bugs. I would like for an individual bug's step to depend on the state of the bugs around it. I defined a simple method called getRole, - (int)getRole; { return role; } My code compiles just fine, but when I run it crashes in the bug's step method at the line...int neighborRole = [[world getObjectAtX: xPos+deltaX Y: yPos+deltaY] getRole];
One thing to check very carefully is whether (xPos+deltaX) or (yPos+deltaY) could ever exceed the size of world. If they do, I think you'll get a segmentation fault.
Steve R. -- Lang Railsback & Associates
[Prev in Thread] | Current Thread | [Next in Thread] |