Who QA's this ****?

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,727
Location
Near Portsmouth, UK
Dear Firaxis,

If you are going to use college students to write your code, please explain to them about "functions" and disable their Ctrl-C/Ctrl-V keys!!!

(From WhosWinningPopup.lua)
Code:
  -- Culture Mode restrictions
  if (iMode == g_ListMode_Culture) then
    -- Anyone in the Industrial Era?
    for iPlayerLoop = 0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
      pLoopPlayer = Players[iPlayerLoop];
      if (pLoopPlayer:IsAlive()) then
        if (pLoopPlayer:GetCurrentEra() >= GameInfo.Eras["ERA_INDUSTRIAL"].ID) then
          print("Progress Screen: Can't display Culture Mode because we've reached the Industrial Era!");
          return false;
        end
      end
    end
  -- Food Mode restrictions
  elseif (iMode == g_ListMode_Food) then
    -- Anyone in the Industrial Era?
    for iPlayerLoop = 0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
      pLoopPlayer = Players[iPlayerLoop];
      if (pLoopPlayer:IsAlive()) then
        if (pLoopPlayer:GetCurrentEra() >= GameInfo.Eras["ERA_INDUSTRIAL"].ID) then
          print("Progress Screen: Can't display Food Mode because we've reached the Industrial Era!");
          return false;
        end
      end
    end
  -- Production Mode restrictions
  elseif (iMode == g_ListMode_Production) then
    -- Anyone in the Industrial Era?
    for iPlayerLoop = 0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
      pLoopPlayer = Players[iPlayerLoop];
      if (pLoopPlayer:IsAlive()) then
        if (pLoopPlayer:GetCurrentEra() >= GameInfo.Eras["ERA_INDUSTRIAL"].ID) then
          print("Progress Screen: Can't display Production Mode because we've reached the Industrial Era!");
          return false;
        end
      end
    end
  end
 
Same sort of thing for specialists, city processes, and many others. Each time I encounter it I have to scratch my head and decide whether to rewrite it all or just "tack on" my own thing.

They forgot to localize the pLoopPlayer too.

Very consistent use of the semicolon, however...
 
I'm under the impression to guy who did the LUA didn't know the language too well. Take a gander at the comment section of DiploCurrentDeals.lua.

But then again, it's hard for me to comment because I don't know the language too well either. But I am a college student. :P Does that absolve me? :D
 
Yields are the worst example of this I've seen, because they are so central to the game that flaws there affect everything. They should have all yields in one table and loop through it with shared functions. Instead, many yields stand alone (like tourism), and often separate functions for each yield!

PHP:
function PlayerClass.GetYieldStored(player, yieldID, itemID)
    if yieldID == YieldTypes.YIELD_GOLD then
        return player:GetGold()
    elseif yieldID == YieldTypes.YIELD_SCIENCE then
        return Teams[player:GetTeam()]:GetTeamTechs():GetResearchProgress(itemID or player:GetCurrentResearch())
    elseif yieldID == YieldTypes.YIELD_CULTURE then
        return player:GetJONSCulture()
    elseif yieldID == YieldTypes.YIELD_HAPPINESS_CITY or yieldID == YieldTypes.YIELD_HAPPINESS_NATIONAL then
        return player:GetGoldenAgeProgressMeter()
    elseif yieldID == YieldTypes.YIELD_FAITH then
        return player:GetFaith()
    elseif yieldID == YieldTypes.YIELD_CS_MILITARY or yieldID == YieldTypes.YIELD_CS_GREAT_PEOPLE then
        return MapModData.Civup.Yields[yieldID][player:GetID()].Stored
    end
    
    return 0
end
 
Do I even need to mention socialpolicypopup.lua?
 
Back
Top Bottom