Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

[3.12.1] Error in database.log #110

Closed skodkim closed 10 years ago

skodkim commented 10 years ago

3.12.1 introduced a new error in database.log, which appears twice: "no such column: Cost"

Don't know how important this is since I haven't played this version yet.

Log attached

\Skodkim database log

stackpoint commented 10 years ago

No such column sounds like a table creation issue but I couldn't find anything in there to indicate a problem. I'll have to check if I can duplicate this error.

GrantSP commented 10 years ago

The log still has the "Cost" listing but since I can't see any in game errors yet perhaps we could leave this active to see if we can connect it with something later.

stackpoint commented 10 years ago

I believe the error is with the commit here: https://github.com/Thalassicus/cep-bnw/commit/18ee2100bae11b4110de292bed2768cba67aaeca#diff-8d42450a3eff6b4f1e36d39f977d12d8

The table Building_Flavors does not have a Cost column. I'm not familiar enough with SQL to fix this. You need to call the Cost column from the Buildings table with the correct row.

GrantSP commented 10 years ago

Not sure what the intent of that sql command is.

There is no need to DELETE anything from _BuildingFlavors. If on the other hand the dummy buildings are being deleted based on the Buildings table I can't see the logic there also. ;(

Thal will need to look at this and decide.

stackpoint commented 10 years ago

The idea behind the code is to delete any flavors from buildings that have a production cost of 0 or -1. This should mostly affect dummy buildings. However, this would(?) affect religion only buildings too and I'm not sure if they require flavors.

GrantSP commented 10 years ago

Yeah but the point I am making is there are none of the targeted buildings in the _BuildingFlavors table. Deleting from the Buildings table would be disastrous, so that can't be the area where the deletions are to take place.

stackpoint commented 10 years ago

I'm not 100% sure about my sql but I believe this is what the fixed code should look like:

DELETE FROM Building_Flavors WHERE BuildingType IN (
    SELECT Type FROM Buildings
    WHERE NOT IsVisible OR NOT (Cost > 0 OR FaithCost > 0)
);

I've added the condition that it must not have a build cost and a faith cost or be invisible to be deleted from the building_flavors table. If this checks out I'll replace the relevant code.

stackpoint commented 10 years ago

Nevermind. It looks like Thal fixed this in the 3.13 release but had not committed it to GitHub.