@@ -102,10 +102,9 @@ DEFINE_HOOK(0x466897, BulletClass_AI_Trailer, 0x6)
102
102
enum { SkipGameCode = 0x4668BD };
103
103
104
104
GET (BulletClass*, pThis, EBP);
105
- GET_STACK ( CoordStruct, coords, STACK_OFFSET (0x1A8 , -0x184 ));
105
+ REF_STACK ( const CoordStruct, coords, STACK_OFFSET (0x1A8 , -0x184 ));
106
106
107
107
auto const pTrailerAnim = GameCreate<AnimClass>(pThis->Type ->Trailer , coords, 1 , 1 );
108
-
109
108
auto const pTrailerAnimExt = AnimExt::ExtMap.Find (pTrailerAnim);
110
109
auto const pOwner = pThis->Owner ? pThis->Owner ->Owner : BulletAITemp::ExtData->FirerHouse ;
111
110
AnimExt::SetAnimOwnerHouseKind (pTrailerAnim, pOwner, nullptr , false , true );
@@ -277,11 +276,11 @@ DEFINE_HOOK(0x46902C, BulletClass_Explode_Cluster, 0x6)
277
276
enum { SkipGameCode = 0x469091 };
278
277
279
278
GET (BulletClass*, pThis, ESI);
280
- GET_STACK ( CoordStruct, origCoords, STACK_OFFSET (0x3C , -0x30 ));
279
+ REF_STACK ( const CoordStruct, origCoords, STACK_OFFSET (0x3C , -0x30 ));
281
280
282
281
auto const pTypeExt = BulletTypeExt::ExtMap.Find (pThis->Type );
283
- int min = pTypeExt->ClusterScatter_Min .Get ();
284
- int max = pTypeExt->ClusterScatter_Max .Get ();
282
+ const int min = pTypeExt->ClusterScatter_Min .Get ();
283
+ const int max = pTypeExt->ClusterScatter_Max .Get ();
285
284
auto coords = origCoords;
286
285
287
286
for (int i = 0 ; i < pThis->Type ->Cluster ; i++)
@@ -425,36 +424,37 @@ DEFINE_JUMP(LJMP, 0x468D08, 0x468D2F);
425
424
426
425
DEFINE_HOOK (0x6FF008 , TechnoClass_Fire_BeforeMoveTo, 0x8 )
427
426
{
428
- GET (BulletClass*, pBullet, EBX);
429
- const auto projectile = pBullet->Type ;
427
+ GET (BulletClass* const , pBullet, EBX);
428
+
429
+ const auto pBulletType = pBullet->Type ;
430
430
431
- if (projectile ->Arcing && !BulletTypeExt::ExtMap.Find (projectile )->Arcing_AllowElevationInaccuracy )
431
+ if (pBulletType ->Arcing && !BulletTypeExt::ExtMap.Find (pBulletType )->Arcing_AllowElevationInaccuracy )
432
432
{
433
- LEA_STACK (BulletVelocity*, velocity, STACK_OFFSET (0xB0 , -0x60 ));
434
- LEA_STACK (CoordStruct*, crdSrc, STACK_OFFSET (0xB0 , -0x6C ));
433
+ REF_STACK (BulletVelocity, velocity, STACK_OFFSET (0xB0 , -0x60 ));
434
+ REF_STACK (const CoordStruct, crdSrc, STACK_OFFSET (0xB0 , -0x6C ));
435
+ REF_STACK (const CoordStruct, crdOffset, STACK_OFFSET (0xB0 , -0x1C ));
436
+ REF_STACK (const CoordStruct, fireCoords, STACK_OFFSET (0xB0 , -0x6C ));
435
437
436
- GET_STACK (CoordStruct, crdOffset, STACK_OFFSET (0xB0 , -0x1C ));
437
- GET_STACK (CoordStruct, fireCoords, STACK_OFFSET (0xB0 , -0x6C ));
438
438
const auto crdTgt = crdOffset + fireCoords;
439
-
440
- BulletExt::ApplyArcingFix (pBullet, *crdSrc, crdTgt, *velocity);
439
+ BulletExt::ApplyArcingFix (pBullet, crdSrc, crdTgt, velocity);
441
440
}
442
441
443
442
return 0 ;
444
443
}
445
444
446
445
DEFINE_HOOK (0x44D46E , BuildingClass_Mission_Missile_BeforeMoveTo, 0x8 )
447
446
{
448
- GET (BulletClass*, pBullet, EDI);
449
- const auto projectile = pBullet->Type ;
447
+ GET (BulletClass* const , pBullet, EDI);
448
+
449
+ const auto pBulletType = pBullet->Type ;
450
450
451
- if (projectile ->Arcing && !BulletTypeExt::ExtMap.Find (projectile )->Arcing_AllowElevationInaccuracy )
451
+ if (pBulletType ->Arcing && !BulletTypeExt::ExtMap.Find (pBulletType )->Arcing_AllowElevationInaccuracy )
452
452
{
453
- LEA_STACK (BulletVelocity* , velocity, STACK_OFFSET (0xE8 , -0xD0 ));
454
- LEA_STACK ( CoordStruct* , crdSrc, STACK_OFFSET (0xE8 , -0x8C ));
455
- GET_STACK ( CoordStruct, crdTgt, STACK_OFFSET (0xE8 , -0x4C ));
453
+ REF_STACK (BulletVelocity, velocity, STACK_OFFSET (0xE8 , -0xD0 ));
454
+ REF_STACK ( const CoordStruct, crdSrc, STACK_OFFSET (0xE8 , -0x8C ));
455
+ REF_STACK ( const CoordStruct, crdTgt, STACK_OFFSET (0xE8 , -0x4C ));
456
456
457
- BulletExt::ApplyArcingFix (pBullet, * crdSrc, crdTgt, * velocity);
457
+ BulletExt::ApplyArcingFix (pBullet, crdSrc, crdTgt, velocity);
458
458
}
459
459
460
460
return 0 ;
0 commit comments