[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Adonthell-devel] Re: Map view progress ...
From: |
Kai Sterker |
Subject: |
Re: [Adonthell-devel] Re: Map view progress ... |
Date: |
Thu, 10 Jul 2008 10:34:27 +0200 |
On Thu, Jul 10, 2008 at 7:18 AM, Julien Laumonier <address@hidden> wrote:
> Not sure if it is the same bug but i get a close related bug with
> worldtest with DEBUG_COLLISION on gcc 4.3. After moving the character,
> it cannot be stopped and seems to walk in a random direction, but not
> each time!
Yes, that's exactly the same.
> However, I
> checked why this behavior appears and it seems that when DEBUG_COLLISION
> is set, a new member (Image in the moving class) is used and seems to be
> not correctly handled.
Yes. It happens when libadonthell_world is compiled without
DEBUG_COLLISION. The extra member means that the heap gets corrupted
and direction information is read from the wrong memory address.
> In summary, I suggest many ways of dealing with this strange behavior :
> 1) Do not use DEBUG_COLLISION_ : not very useful but quick
> 2) Move the current_dir() method in the character.cc file : correct the
> behavior but not the reasons
> 3) Check the moving class or the resize method or any related thing.
A fourth possibility might be to use #if DEBUG_COLLISION instead of
#ifdef, because then a #define DEBUG_COLLISION 0 in worldtest.cc would
no longer trigger the issue.
> Another aspect on the map_view class is the initialization of the
> members. Args and Schedule should be initialized to NULL. Otherwise it
> could result in a segfault during the set_schedule() method.
Yeah. I tend to forget that. I'll fix that with the rest of my changes
to the world module. Thanks for letting me know :-).
Kai