Scoring working now ...

This commit is contained in:
FlightControl
2016-04-26 11:41:58 +02:00
parent 847813c741
commit 56fca825f0
2 changed files with 8 additions and 10 deletions

View File

@@ -5489,7 +5489,6 @@ local _SCORINGCategory =
--- Creates a new SCORING object to administer the scoring achieved by players.
-- @param #SCORING self
-- @param #string GameName The name of the game. This name is also logged in the CSV score file.
-- @param #string ScoringCSV The name of the CSV file.
-- @return #SCORING self
-- @usage
-- -- Define a new scoring object for the mission Gori Valley.
@@ -6146,7 +6145,7 @@ function SCORING:OpenCSV( ScoringCSV )
if lfs and io and os then
if ScoringCSV then
self.ScoringCSV = ScoringCSV
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. os.date( "%Y-%m-%d_%H-%M-%S" ) .. ".csv"
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv"
self.CSVFile, self.err = io.open( fdir, "w+" )
if not self.CSVFile then
@@ -6160,7 +6159,7 @@ function SCORING:OpenCSV( ScoringCSV )
error( "A string containing the CSV file name must be given." )
end
else
self:E( "The MissionScripting.lua file has not been change to allow lfs, io and os modules to be used..." )
self:E( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
end
return self
end
@@ -6231,7 +6230,7 @@ function SCORING:ScoreCSV( PlayerName, ScoreType, ScoreTimes, ScoreAmount, Playe
TargetUnitName = ''
end
if lfs then
if lfs and io and os then
self.CSVFile:write(
'"' .. self.GameName .. '"' .. ',' ..
'"' .. self.RunTime .. '"' .. ',' ..
@@ -6256,7 +6255,7 @@ end
function SCORING:CloseCSV()
if lfs then
if lfs and io and os then
self.CSVFile:close()
end
end