don't need the cell actually

This commit is contained in:
Lilian Jónsdóttir 2020-09-06 16:02:18 -07:00
parent 57399d5da2
commit 83a69bf9c1
2 changed files with 9 additions and 9 deletions

View file

@ -300,9 +300,9 @@ this.isIgnoredDoor = function(door, homeCellId)
not hasOccupants
end
-- AT NIGHT
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",
tes3.worldController.hour.value, atNight and "" or "not ", config.closeTime, config.openTime)
@ -310,13 +310,13 @@ this.isNight = function()
end
-- inclement weather
this.isInclementWeather = function(cell)
if not cell.region then return false end
-- local index = cell.region.weather.index
this.isInclementWeather = function()
if not tes3.getCurrentWeather() then return false end
local index = tes3.getCurrentWeather().index
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)
return isBad

View file

@ -119,7 +119,7 @@ end
this.processNPCs = function(cell)
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)
@ -176,7 +176,7 @@ this.processSiltStriders = function(cell)
for activator in cell:iterateReferences(tes3.objectType.activator) do
log(common.logLevels.large, "Is %s a silt strider??", activator.object.id)
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
log(common.logLevels.medium, "Disabling silt strider %s!", activator.object.name)
mwscript.disable({reference = activator})
@ -200,7 +200,7 @@ end
this.processPets = function(cell)
if not config.disableNPCs then return end
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)