Mercurial > mm7
diff mm7_6.cpp @ 79:6ad816231528
structure fixes, death crash fix
author | zipi |
---|---|
date | Sat, 02 Feb 2013 16:52:36 +0000 |
parents | 2bcc7b24c831 |
children | 377535d6e366 |
line wrap: on
line diff
--- a/mm7_6.cpp Tue Jan 29 07:51:31 2013 +0600 +++ b/mm7_6.cpp Sat Feb 02 16:52:36 2013 +0000 @@ -8671,33 +8671,35 @@ } //----- (0042FA22) -------------------------------------------------------- -char *__cdecl sub_42FA22_mess_with_laying_item_list() +LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list() { size_t v0; // edx@1 int v1; // ebp@1 - char *result; // eax@1 - void *v3; // ebx@1 + LayingItem *result; // eax@1 + LayingItem *v3; // ebx@1 v0 = 0; v1 = 0; - result = (char *)&pLayingItems[0].uObjectDescID; + //result = (char *)&pLayingItems[0].uObjectDescID; + result = pLayingItems; v3 = pLayingItems; do { - if ( *(short *)result ) + if ( result->uObjectDescID ) { if ( v1 != v0 ) { - memcpy(v3, result - 2, 0x70u); - *(short *)result = 0; + memcpy(v3, result, 0x70u); + result->uObjectDescID = 0; } ++v0; - v3 = (char *)v3 + 112; + ++v3;// = (char *)v3 + 112; } - result += 112; + ++result;// += 112; ++v1; } - while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); + //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) ); + while( result <= &pLayingItems[999] ); uNumLayingItems = v0; return result; }