Skip to content

Commit 89413d9

Browse files
committed
Fix incorrect logic in 69d45d1
1 parent 69d45d1 commit 89413d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Ext/Building/Hooks.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,17 +631,20 @@ DEFINE_HOOK(0x4C9C7B, FactoryClass_QueueProduction_ForceCheckBuilding, 0x7)
631631
return RulesExt::Global()->BuildingProductionQueue ? SkipGameCode : 0;
632632
}
633633

634-
DEFINE_JUMP(LJMP, 0x4FABEE, 0x4FAB3D)
635-
636634
DEFINE_HOOK(0x4FAAD8, HouseClass_AbandonProduction_RewriteForBuilding, 0x8)
637635
{
638-
enum { CheckSame = 0x4FAB3D, Return = 0x4FAC9B };
636+
enum { CheckSame = 0x4FAB3D, SkipCheck = 0x4FAB64, Return = 0x4FAC9B };
639637

640638
GET_STACK(const bool, all, STACK_OFFSET(0x18, 0x10));
641639
GET(const int, index, EBX);
640+
GET(const BuildCat, buildCat, ECX);
642641
GET(const AbstractType, absType, EBP);
643642
GET(FactoryClass* const, pFactory, ESI);
644643

644+
// After placing the building, the factory will be in this state
645+
if (buildCat != BuildCat::DontCare && !all && !pFactory->Object)
646+
return SkipCheck;
647+
645648
const auto pType = TechnoTypeClass::GetByTypeAndIndex(absType, index);
646649
const auto firstRemoved = pFactory->RemoveOneFromQueue(pType);
647650

0 commit comments

Comments
 (0)