Skip to content

Commit

Permalink
v3.18.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaakma committed Dec 11, 2023
1 parent 596f2c6 commit 0b688d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Data Files/Ashfall-metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A camping, survival and needs mod for Morrowind."
homepage = "https://www.nexusmods.com/morrowind/mods/49057"
repository = "https://github.com/jhaakma/ashfall"
authors = [ "Merlord",]
version = "3.18.5"
version = "3.18.7"

[dependencies]
assets = [ "Ashfall.esp", "Icons/ashfall", "Meshes/ashfall", "MWSE/mods/mer/ashfall", "Sound/ashfall", "Textures/Ashfall",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ local callbacks = {
end
end,
---@param self CarryableContainer
---@param data CarryableContainer.onCopyCreatedData
onCopyCreated = function(self, data)
-- logger:trace("onCopyCreated")
-- Backpack.registerBackpack(data.copy.id)
-- common.data.backpacks[data.copy.id:lower()] = true
end,
---@param self CarryableContainer
getWeightModifier = function(self)
logger:trace("getWeightModifier()")
--Set weight modifier to 0.1 if the backpack is equipped,
Expand Down Expand Up @@ -93,7 +86,6 @@ local containers = {
capacity = 120,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.3,
Expand All @@ -104,7 +96,6 @@ local containers = {
capacity = 120,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.3,
Expand All @@ -115,7 +106,6 @@ local containers = {
capacity = 120,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.5,
Expand All @@ -126,7 +116,6 @@ local containers = {
capacity = 100,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.5,
Expand All @@ -137,7 +126,6 @@ local containers = {
capacity = 150,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.5,
Expand All @@ -148,7 +136,6 @@ local containers = {
capacity = 120,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.3,
Expand All @@ -159,7 +146,6 @@ local containers = {
capacity = 100,
hasCollision = true,
openFromInventory = callbacks.openFromInventory,
onCopyCreated = callbacks.onCopyCreated,
getWeightModifier = callbacks.getWeightModifier,
getWeightModifierText = callbacks.getWeightModifierText,
weightModifier = 0.7,
Expand Down
2 changes: 1 addition & 1 deletion Data Files/MWSE/mods/mer/ashfall/interop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Interop.getBackPackWoodAxeIds = function()
return table.copy(backpackConfig.woodAxes)
end

---@param data { id: string, registerForBackpacks: boolean }[]
---@param data (string|{ id: string, registerForBackpacks: boolean })[]
function Interop.registerWoodAxes(data)
logger:info("Registering Wood Axes")
for _, v in pairs(data) do
Expand Down
20 changes: 6 additions & 14 deletions Data Files/MWSE/mods/mer/ashfall/items/backpack/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,18 @@ local function onEquipped(e)
if not fileName then
return
end

-- get parent for attaching
local parent = e.reference.sceneNode:getObjectByName("Bip01 Spine1")

-- detach old backpack mesh
detachBackpack(parent)
-- attach new backpack mesh
attachBackpack(parent, fileName, e.reference)

--timer.delayOneFrame(function()
setSwitchNodes{reference=e.reference}
--end)

setSwitchNodes{reference=e.reference}
-- update parent scene node
parent:update()
parent:updateNodeEffects()
end
event.register("equipped", onEquipped)


local function onUnequipped(e)
Expand All @@ -232,7 +227,7 @@ local function onUnequipped(e)
parent:update()
parent:updateNodeEffects()
end

event.register("unequipped", onUnequipped)

local function onMobileActivated(e)
if e.reference.object.equipment then
Expand All @@ -241,15 +236,16 @@ local function onMobileActivated(e)
end
end
end
event.register("mobileActivated", onMobileActivated)

local function onLoaded(e)
event.register("loaded", function(e)
onMobileActivated{reference=tes3.player}
for i, cell in ipairs(tes3.getActiveCells()) do
for ref in cell:iterateReferences(tes3.objectType.npc) do
onMobileActivated{reference=ref}
end
end
end
end)

---@param e objectCreatedEventData
event.register("objectCreated", function(e)
Expand All @@ -260,10 +256,6 @@ event.register("objectCreated", function(e)
end
end)

event.register("loaded", onLoaded)
event.register("equipped", onEquipped)
event.register("unequipped", onUnequipped)
event.register("mobileActivated", onMobileActivated)
event.register("activate", function(e)
if e.activator == tes3.player then
timer.delayOneFrame(function()
Expand Down

0 comments on commit 0b688d6

Please sign in to comment.