Skip to content

Commit

Permalink
Fix #10256
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Sep 26, 2023
1 parent 813e1ef commit 189111c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions (1) Community Patch/Core Files/Text/CoreText_en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@

<!-- Construction -->
<Row Tag="TXT_KEY_NOTIFICATION_QUEST_BUILD_X_BUILDINGS">
<Text>Builders from {3_Civ} are eager to study the value of the [COLOR_POSITIVE_TEXT]{1_Building}[ENDCOLOR]. {3_Civ} promises great reward if you construct [COLOR_POSITIVE_TEXT]{2_Num}[ENDCOLOR] of these buildings across your empire.</Text>
<Text>Builders from {3_Civ} are eager to study the value of the [COLOR_POSITIVE_TEXT]{1_Building}[ENDCOLOR]. {3_Civ} promises great reward if you construct [COLOR_POSITIVE_TEXT]{2_Num}[ENDCOLOR] of these buildings across non-puppet cities in your empire.</Text>
</Row>
<Row Tag="TXT_KEY_NOTIFICATION_SUMMARY_QUEST_BUILD_X_BUILDINGS">
<Text>Construction project from {@1_Civ}</Text>
Expand Down Expand Up @@ -2762,7 +2762,7 @@
<Text>Explore an unrevealed area of the world ([COLOR_POSITIVE_TEXT]{1_Num}[ENDCOLOR]% complete).</Text>
</Row>
<Row Tag="TXT_KEY_CITY_STATE_QUEST_BUILD_X_BUILDINGS_FORMAL">
<Text>Construct [COLOR_POSITIVE_TEXT]{2_Num}[ENDCOLOR] {@1_Building} {2_Num: plural 1?building; other?buildings;} in your empire.</Text>
<Text>Construct [COLOR_POSITIVE_TEXT]{2_Num}[ENDCOLOR] {@1_Building} {2_Num: plural 1?building; other?buildings;} in non-puppet cities in your empire.</Text>
</Row>
<Row Tag="TXT_KEY_CITY_STATE_QUEST_SPY_ON_MAJOR_FORMAL">
<Text>Conduct intelligence operations against {1_Civ} ([COLOR_POSITIVE_TEXT]{2_Num}[ENDCOLOR] remaining).</Text>
Expand Down
17 changes: 13 additions & 4 deletions CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ void CvLuaPlayer::PushMethods(lua_State* L, int t)
Method(QuestSpyActionsRemaining);
Method(GetXQuestBuildingRemaining);
Method(GetExplorePercent);
Method(GetXQuestBuildingRemaining);
Method(GetRewardString);
Method(GetExplorePercent);
Method(GetTargetCityString);
Expand Down Expand Up @@ -8635,9 +8634,19 @@ int CvLuaPlayer::lGetXQuestBuildingRemaining(lua_State* L)
const MinorCivQuestTypes eType = (MinorCivQuestTypes) lua_tointeger(L, 3);
const BuildingTypes eBuilding = (BuildingTypes) lua_tointeger(L, 4);
int iNeeded = pkPlayer->GetMinorCivAI()->GetQuestData2(ePlayer, eType);
int iBuilt = GET_PLAYER(ePlayer).getNumBuildings(eBuilding);
int iBuilt = 0;
int iLoop = 0;
for (CvCity* pLoopCity = GET_PLAYER(ePlayer).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER(ePlayer).nextCity(&iLoop))
{
// Exclude puppets
if (pLoopCity->IsPuppet())
continue;

if (pLoopCity->GetCityBuildings()->GetNumBuilding(eBuilding) > 0)
iBuilt++;
}

const int iResult = (iNeeded - iBuilt);
const int iResult = iNeeded - iBuilt;
lua_pushinteger(L, iResult);
return 1;
}
Expand All @@ -8650,7 +8659,7 @@ int CvLuaPlayer::lQuestSpyActionsRemaining(lua_State* L)
int iNeeded = pkPlayer->GetMinorCivAI()->GetQuestData2(ePlayer, eType);
int iDone = GET_PLAYER(ePlayer).GetEspionage()->GetNumSpyActionsDone(eTargetPlayer);

const int iResult = (iNeeded - iDone);
const int iResult = iNeeded - iDone;
lua_pushinteger(L, iResult);
return 1;
}
Expand Down

0 comments on commit 189111c

Please sign in to comment.