@@ -78,7 +78,7 @@ static void CreateDeployingAnim(UnitClass* pUnit, bool isDeploying)
78
78
pAnimType = GeneralUtils::GetItemForDirection<AnimTypeClass*>(pTypeExt->DeployingAnims , pUnit->PrimaryFacing .Current ());
79
79
80
80
auto const pAnim = GameCreate<AnimClass>(pAnimType, pUnit->Location , 0 , 1 , 0x600 , 0 ,
81
- !isDeploying ? pTypeExt->DeployingAnim_ReverseForUndeploy : false );
81
+ !isDeploying && pTypeExt->DeployingAnim_ReverseForUndeploy );
82
82
83
83
pUnit->DeployAnim = pAnim;
84
84
pAnim->SetOwnerObject (pUnit);
@@ -240,29 +240,40 @@ DEFINE_HOOK(0x54C76D, JumpjetLocomotionClass_Descending_DeployDir, 0x7)
240
240
241
241
// Disable DeployToLand=no forcing landing when idle due to what appears to be
242
242
// a code oversight and no need for DeployToLand=no to work in vanilla game.
243
- DEFINE_HOOK (0x54BE3E , JumpjetLocomotionClass_Hovering_DeployToLand, 0x6 )
243
+ DEFINE_HOOK (0x54BED4 , JumpjetLocomotionClass_Hovering_DeployToLand, 0x7 )
244
244
{
245
245
enum { SkipGameCode = 0x54BEE0 };
246
246
247
+ GET (JumpjetLocomotionClass*, pThis, ESI);
247
248
GET (FootClass*, pLinkedTo, ECX);
248
249
249
- if (!pLinkedTo->GetTechnoType ()->DeployToLand )
250
- return SkipGameCode;
250
+ auto const pType = pLinkedTo->GetTechnoType ();
251
251
252
- return 0 ;
252
+ if (!pType->BalloonHover || pType->DeployToLand )
253
+ pThis->State = JumpjetLocomotionClass::State::Descending;
254
+
255
+ pLinkedTo->TryNextPlanningTokenNode ();
256
+ return SkipGameCode;
253
257
}
254
258
255
- // Same as above but at different state.
259
+ // Same as above but at a different state.
256
260
DEFINE_HOOK (0x54C2DF , JumpjetLocomotionClass_Cruising_DeployToLand, 0xA )
257
261
{
258
262
enum { SkipGameCode = 0x54C4FD };
259
263
264
+ GET (JumpjetLocomotionClass*, pThis, ESI);
260
265
GET (FootClass*, pLinkedTo, ECX);
261
266
262
- if (!pLinkedTo->GetTechnoType ()->DeployToLand )
263
- return SkipGameCode;
267
+ auto const pType = pLinkedTo->GetTechnoType ();
264
268
265
- return 0 ;
269
+ if (!pType->BalloonHover || pType->DeployToLand )
270
+ {
271
+ pThis->CurrentHeight = 0 ;
272
+ pThis->State = JumpjetLocomotionClass::State::Descending;
273
+ }
274
+
275
+ pLinkedTo->TryNextPlanningTokenNode ();
276
+ return SkipGameCode;
266
277
}
267
278
268
279
// Disable Ares hover locomotor bobbing processing DeployToLand hook.
@@ -376,7 +387,7 @@ DEFINE_HOOK(0x4DA9F3, FootClass_AI_DeployToLand, 0x6)
376
387
// Allow keeping unit visible while displaying DeployingAnim.
377
388
DEFINE_HOOK (0x73CF46 , UnitClass_Draw_It_KeepUnitVisible, 0x6 )
378
389
{
379
- enum { KeepUnitVisible = 0x73CF62 };
390
+ enum { Continue = 0x73CF62 , DoNotDraw = 0x73D43F };
380
391
381
392
GET (UnitClass*, pThis, ESI);
382
393
@@ -385,10 +396,12 @@ DEFINE_HOOK(0x73CF46, UnitClass_Draw_It_KeepUnitVisible, 0x6)
385
396
const auto pTypeExt = TechnoTypeExt::ExtMap.Find (pThis->Type );
386
397
387
398
if (pTypeExt->DeployingAnim_KeepUnitVisible || (pThis->Deploying && !pThis->DeployAnim ))
388
- return KeepUnitVisible;
399
+ return Continue;
400
+
401
+ return DoNotDraw;
389
402
}
390
403
391
- return 0 ;
404
+ return Continue ;
392
405
}
393
406
394
407
// Disable deploy cursor if Ares type conversion on deploy is available and the new type is not allowed to move to the cell.
0 commit comments