Skip to content

Commit

Permalink
Gets new game's start time from FlightLog to be compared with minTime
Browse files Browse the repository at this point in the history
uses Game.GetStartTime() function from #5291 PR
  • Loading branch information
jimishol authored and Web-eWorks committed May 20, 2022
1 parent eefa1b6 commit cce74e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/modules/NewsEventCommodity/NewsEventCommodity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local Equipment = require 'Equipment'
local l = Lang.GetResource("module-newseventcommodity")

local maxDist = 50 -- for spawning news (ly)
local minTime = 15768000 -- no news the first 5 months of a new game (sec)
local minTime = 15768000 -- no news the first 6 months of a new game (sec)

-- to spawn a new event per hyperjump, provided no other news.
local eventProbability = 1/20
Expand Down Expand Up @@ -319,7 +319,7 @@ local onEnterSystem = function (player)

-- create a news event with low probability
if Engine.rand:Number(0,1) < eventProbability and
#news <= maxNumberNews and Game.time > minTime then
#news <= maxNumberNews and Game.GetStartTime() > minTime then
createNewsEvent(timeInHyperspace)
end

Expand Down

0 comments on commit cce74e3

Please sign in to comment.