On Sun, 28 Jan 2007 20:59:17 -0800, "The Watermelon" <[EMAIL PROTECTED]> wrote:
> On 1/28/07, Giel van Schijndel <[EMAIL PROTECTED]> wrote:
>>
>> Author: muggenhor
>> Date: Sun Jan 28 19:19:32 2007
>> New Revision: 686
>>
>> URL: http://svn.gna.org/viewcvs/warzone?rev=686&view=rev
>> Log:
>> Modification 8 by Watermelon's bugfix patch:
>> * Changed establishTargetHeight in projectile.c to use pIMD rather than
>> displayImd for structures to fix some weird height problems(hopefully).
>> * Giel: Slightly changed the patch's modifications to increase code
>> readability
>>
>> Refer: Message-ID: <
>> [EMAIL PROTECTED]>
>>
>> Modified:
>>    trunk/src/projectile.c
> 
> some of your change swapped the correct order and causes crash:
> 
>  *  height = asBodyStats[psDroid->asBits[COMP_BODY].nStat].pIMD->ymax -
> asBodyStats[psDroid->asBits[COMP_BODY].nStat].pIMD->ymin;*
> 
> *   psDroid = (DROID*)psTarget;*
> 
> it tried to access psDroid pointer before it gets initialized as
> (DROID*)psTarget,the original/correct order is:
> 
> *   psDroid = (DROID*)psTarget;
>    height = asBodyStats[psDroid->asBits[COMP_BODY].nStat].pIMD->ymax -
> asBodyStats[psDroid->asBits[COMP_BODY].nStat].pIMD->ymin;*
> 
> 

It seems Ari fixed this in r688. Would have been nice if the compiler would 
just kick my ass on this sorts of cases (dereferencing uninitialized pointers).

-- 
Giel


_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to