Skip to content
Snippets Groups Projects
Commit b1d864dd authored by DarkGod's avatar DarkGod
Browse files

plopupdate

parent 250a394e
No related branches found
No related tags found
No related merge requests found
......@@ -356,7 +356,7 @@ end
--- Tries to apply all birth options to the actor. Should only be called once, at the end of creation
--
function _M:apply()
function _M:apply(self_contained)
self.actor.descriptor = {}
local stats, inc_stats = {}, {}
for i, d in ipairs(self.descriptors) do
......@@ -421,7 +421,7 @@ function _M:apply()
self.actor.body = d.body
self.actor:initBody()
end
if self.applyingDescriptor then self:applyingDescriptor(i, d) end
if self.applyingDescriptor then self:applyingDescriptor(i, d, self_contained) end
end
-- Apply stats now to not be overridden by other things
......
......@@ -102,7 +102,7 @@ function melindaCompanion(self, who, c, sc)
birth:setDescriptor("class", c)
birth:setDescriptor("subclass", sc)
birth.actor = melinda
birth:apply()
birth:apply(true)
melinda.image = "player/cornac_female_redhair.png"
melinda.moddable_tile_base = "base_redhead_01.png"
melinda.moddable_tile_ornament = {female="braid_redhead_01"}
......
......@@ -252,7 +252,7 @@ function _M:checkNew(fct)
end
end
function _M:applyingDescriptor(i, d)
function _M:applyingDescriptor(i, d, self_contained)
if d.unlockable_talents_types then
for t, v in pairs(d.unlockable_talents_types) do
if profile.mod.allow_build[v[3]] then
......@@ -267,17 +267,19 @@ function _M:applyingDescriptor(i, d)
end
end
end
if d.party_copy then
local copy = table.clone(d.party_copy, true)
-- Append array part
while #copy > 0 do
local f = table.remove(copy)
table.insert(game.party, f)
if not self_contained then
if d.party_copy then
local copy = table.clone(d.party_copy, true)
-- Append array part
while #copy > 0 do
local f = table.remove(copy)
table.insert(game.party, f)
end
-- Copy normal data
table.merge(game.party, copy, true)
end
-- Copy normal data
table.merge(game.party, copy, true)
self:applyGameState(d)
end
self:applyGameState(d)
end
function _M:applyGameState(d)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment