don't need the cell actually
This commit is contained in:
parent
57399d5da2
commit
83a69bf9c1
|
@ -300,9 +300,9 @@ this.isIgnoredDoor = function(door, homeCellId)
|
||||||
not hasOccupants
|
not hasOccupants
|
||||||
end
|
end
|
||||||
|
|
||||||
-- AT NIGHT
|
|
||||||
this.isNight = function()
|
this.isNight = function()
|
||||||
local atNight = tes3.worldController.hour.value >= config.closeTime or tes3.worldController.hour.value <= config.openTime
|
local atNight = tes3.worldController.hour.value >= config.closeTime or -- AT NIGHT
|
||||||
|
tes3.worldController.hour.value <= config.openTime
|
||||||
log(common.logLevels.large, "Current time is %.2f (%snight), things are closed between %s and %s",
|
log(common.logLevels.large, "Current time is %.2f (%snight), things are closed between %s and %s",
|
||||||
tes3.worldController.hour.value, atNight and "" or "not ", config.closeTime, config.openTime)
|
tes3.worldController.hour.value, atNight and "" or "not ", config.closeTime, config.openTime)
|
||||||
|
|
||||||
|
@ -310,13 +310,13 @@ this.isNight = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- inclement weather
|
-- inclement weather
|
||||||
this.isInclementWeather = function(cell)
|
this.isInclementWeather = function()
|
||||||
if not cell.region then return false end
|
if not tes3.getCurrentWeather() then return false end
|
||||||
-- local index = cell.region.weather.index
|
|
||||||
local index = tes3.getCurrentWeather().index
|
local index = tes3.getCurrentWeather().index
|
||||||
local isBad = index >= config.worstWeather
|
local isBad = index >= config.worstWeather
|
||||||
|
|
||||||
log(common.logLevels.large, "Weather in %s: current:%s >= configured worst:%s == %s", cell.id, index,
|
log(common.logLevels.large, "Weather in %s: current:%s >= configured worst:%s == %s", tes3.getRegion().id, index,
|
||||||
config.worstWeather, isBad)
|
config.worstWeather, isBad)
|
||||||
|
|
||||||
return isBad
|
return isBad
|
||||||
|
|
|
@ -119,7 +119,7 @@ end
|
||||||
|
|
||||||
this.processNPCs = function(cell)
|
this.processNPCs = function(cell)
|
||||||
local night = checks.isNight()
|
local night = checks.isNight()
|
||||||
local badWeather = checks.isInclementWeather(cell)
|
local badWeather = checks.isInclementWeather()
|
||||||
|
|
||||||
log(common.logLevels.small, "Looking for NPCs to process in cell:%s", cell.id)
|
log(common.logLevels.small, "Looking for NPCs to process in cell:%s", cell.id)
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ this.processSiltStriders = function(cell)
|
||||||
for activator in cell:iterateReferences(tes3.objectType.activator) do
|
for activator in cell:iterateReferences(tes3.objectType.activator) do
|
||||||
log(common.logLevels.large, "Is %s a silt strider??", activator.object.id)
|
log(common.logLevels.large, "Is %s a silt strider??", activator.object.id)
|
||||||
if activator.object.id:match("siltstrider") then
|
if activator.object.id:match("siltstrider") then
|
||||||
if checks.isNight() or (checks.isInclementWeather(cell) and not config.keepBadWeatherNPCs) then
|
if checks.isNight() or (checks.isInclementWeather() and not config.keepBadWeatherNPCs) then
|
||||||
if not activator.disabled then
|
if not activator.disabled then
|
||||||
log(common.logLevels.medium, "Disabling silt strider %s!", activator.object.name)
|
log(common.logLevels.medium, "Disabling silt strider %s!", activator.object.name)
|
||||||
mwscript.disable({reference = activator})
|
mwscript.disable({reference = activator})
|
||||||
|
@ -200,7 +200,7 @@ end
|
||||||
this.processPets = function(cell)
|
this.processPets = function(cell)
|
||||||
if not config.disableNPCs then return end
|
if not config.disableNPCs then return end
|
||||||
local night = checks.isNight()
|
local night = checks.isNight()
|
||||||
local badWeather = checks.isInclementWeather(cell)
|
local badWeather = checks.isInclementWeather()
|
||||||
|
|
||||||
log(common.logLevels.small, "Looking for NPC pets to process in cell:%s", cell.name)
|
log(common.logLevels.small, "Looking for NPC pets to process in cell:%s", cell.name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue