Mercurial > mm7
comparison mm7_1.cpp @ 82:1faa29fd4c2d
many type, memory, boundary fixes
author | zipi |
---|---|
date | Sun, 03 Feb 2013 23:37:17 +0000 |
parents | 377535d6e366 |
children | 98cd93e14777 |
comparison
equal
deleted
inserted
replaced
81:377535d6e366 | 82:1faa29fd4c2d |
---|---|
4251 char *result; // eax@18 | 4251 char *result; // eax@18 |
4252 char Dst[144]; // [sp+Ch] [bp-A0h]@1 | 4252 char Dst[144]; // [sp+Ch] [bp-A0h]@1 |
4253 int v9; // [sp+9Ch] [bp-10h]@10 | 4253 int v9; // [sp+9Ch] [bp-10h]@10 |
4254 unsigned int v10; // [sp+A0h] [bp-Ch]@1 | 4254 unsigned int v10; // [sp+A0h] [bp-Ch]@1 |
4255 unsigned int v11; // [sp+A4h] [bp-8h]@8 | 4255 unsigned int v11; // [sp+A4h] [bp-8h]@8 |
4256 unsigned int *v12; // [sp+A8h] [bp-4h]@9 | 4256 ItemGen *v12; // [sp+A8h] [bp-4h]@9 |
4257 | 4257 |
4258 v1 = 0; | 4258 v1 = 0; |
4259 v2 = uChestID; | 4259 v2 = uChestID; |
4260 v10 = uChestID; | 4260 v10 = uChestID; |
4261 pRenderer->ClearZBuffer(0, 479); | 4261 pRenderer->ClearZBuffer(0, 479); |
4280 while ( v1 < uChestArea ); | 4280 while ( v1 < uChestArea ); |
4281 } | 4281 } |
4282 v11 = 0; | 4282 v11 = 0; |
4283 if ( uChestArea > 0 ) | 4283 if ( uChestArea > 0 ) |
4284 { | 4284 { |
4285 v12 = &pChests[v3].mm7__vector_pItems[0].uAttributes; | 4285 v12 = pChests[v3].mm7__vector_pItems;//&pChests[v3].mm7__vector_pItems[0].uAttributes; |
4286 do | 4286 do |
4287 { | 4287 { |
4288 v9 = *(v12 - 5); | 4288 v9 = v12->uItemID; |
4289 if ( v9 ) | 4289 if ( v9 ) |
4290 { | 4290 { |
4291 v6 = 0; | 4291 v6 = 0; |
4292 while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) ) | 4292 while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) ) |
4293 { | 4293 { |
4294 ++v6; | 4294 ++v6; |
4295 if ( v6 >= uChestArea ) | 4295 if ( v6 >= uChestArea ) |
4296 goto LABEL_17; | 4296 break; |
4297 } | 4297 } |
4298 Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10); | 4298 if(v6<uChestArea) |
4299 if ( pChests[v3].uFlags & 4 ) | 4299 { |
4300 *v12 |= 1u; | 4300 Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10); |
4301 } | 4301 if ( pChests[v3].uFlags & 4 ) |
4302 LABEL_17: | 4302 v12->uAttributes |= 1u; |
4303 } | |
4304 } | |
4303 ++v11; | 4305 ++v11; |
4304 v12 += 9; | 4306 ++v12; |
4305 } | 4307 } |
4306 while ( (signed int)v11 < uChestArea ); | 4308 while ( (signed int)v11 < uChestArea ); |
4307 } | 4309 } |
4308 result = (char *)&pChests[v3].uFlags; | 4310 result = (char *)&pChests[v3].uFlags; |
4309 pChests[v3].uFlags = pChests[v3].uFlags & 0xFFFB | 2; | 4311 pChests[v3].uFlags = pChests[v3].uFlags & 0xFFFB | 2; |