Skip to content

Commit

Permalink
Fixes the game allowing the player to queue one unit too few when a u…
Browse files Browse the repository at this point in the history
…nit has BuildLimit > 1.
  • Loading branch information
Rampastring committed Feb 10, 2023
1 parent f3c37b3 commit 25c023e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/extensions/house/houseext_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ DECLARE_PATCH(_HouseClass_Can_Build_BuildCheat_Patch)


/**
* #issue-715
* #issue-611, #issue-715
*
* Gets the number of queued objects when determining whether a cameo
* should be disabled.
Expand All @@ -184,6 +184,15 @@ int _HouseClass_ShouldDisableCameo_Get_Queued_Count(FactoryClass* factory, Techn
return count;
}

/**
* #issue-611
*
* If the object has a build limit, then reduce count by 1
*/
if (technotype->BuildLimit > 0) {
count--;
}

/**
* #issue-715
*
Expand All @@ -204,10 +213,13 @@ int _HouseClass_ShouldDisableCameo_Get_Queued_Count(FactoryClass* factory, Techn


/**
* #issue-715
* #issue-611, #issue-715
*
* Fixes the game allowing the player to queue one unit too few
* when a unit has BuildLimit > 1.
*
* Updates the build limit logic with unit queuing to
* take our unit transformation logic into account.
* Also updates the logic to take our unit transformation logic
* into account.
*/
DECLARE_PATCH(_HouseClass_ShouldDisableCameo_BuildLimit_Fix)
{
Expand Down

0 comments on commit 25c023e

Please sign in to comment.