@@ -631,45 +631,32 @@ DEFINE_HOOK(0x4C9C7B, FactoryClass_QueueProduction_ForceCheckBuilding, 0x7)
631631 return RulesExt::Global ()->BuildingProductionQueue ? SkipGameCode : 0 ;
632632}
633633
634+ DEFINE_JUMP (LJMP, 0x4FABEE , 0x4FAB3D )
635+
634636DEFINE_HOOK(0x4FAAD8 , HouseClass_AbandonProduction_RewriteForBuilding, 0x8 )
635637{
636- enum { CheckSame = 0x4FAB3D , SkipCheck = 0x4FAB64 , Return = 0x4FAC9B };
638+ enum { CheckSame = 0x4FAB3D , Return = 0x4FAC9B };
637639
638640 GET_STACK (const bool , all, STACK_OFFSET (0x18 , 0x10 ));
639641 GET (const int , index, EBX);
640- GET (const BuildCat, buildCat, ECX);
641642 GET (const AbstractType, absType, EBP);
642643 GET (FactoryClass* const , pFactory, ESI);
643644
644- if (buildCat == BuildCat::DontCare || all)
645- {
646- const auto pType = TechnoTypeClass::GetByTypeAndIndex (absType, index);
647- const auto firstRemoved = pFactory->RemoveOneFromQueue (pType);
645+ const auto pType = TechnoTypeClass::GetByTypeAndIndex (absType, index);
646+ const auto firstRemoved = pFactory->RemoveOneFromQueue (pType);
648647
649- if (firstRemoved)
650- {
651- SidebarClass::Instance.SidebarBackgroundNeedsRedraw = true ; // Added, force redraw strip
652- SidebarClass::Instance.RepaintSidebar (SidebarClass::GetObjectTabIdx (absType, index, 0 ));
653-
654- if (all)
655- while (pFactory->RemoveOneFromQueue (pType));
656- else
657- return Return;
658- }
648+ if (firstRemoved)
649+ {
650+ SidebarClass::Instance.SidebarBackgroundNeedsRedraw = true ; // Added, force redraw strip
651+ SidebarClass::Instance.RepaintSidebar (SidebarClass::GetObjectTabIdx (absType, index, 0 ));
659652
660- return CheckSame;
653+ if (all)
654+ while (pFactory->RemoveOneFromQueue (pType));
655+ else
656+ return Return;
661657 }
662658
663- if (!pFactory->Object )
664- return SkipCheck;
665-
666- if (!pFactory->RemoveOneFromQueue (TechnoTypeClass::GetByTypeAndIndex (absType, index)))
667- return CheckSame;
668-
669- SidebarClass::Instance.SidebarBackgroundNeedsRedraw = true ; // Added, force redraw strip
670- SidebarClass::Instance.RepaintSidebar (SidebarClass::GetObjectTabIdx (absType, index, 0 ));
671-
672- return Return;
659+ return CheckSame;
673660}
674661
675662DEFINE_HOOK (0x6A9C54 , StripClass_DrawStrip_FindFactoryDehardCode, 0x6 )
0 commit comments