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

Merge branch 'chrono_fix' into 'master'

Chrono clone fix

Fix nil index error in makeParadoxClone

I'm not sure how/why it happened, but while testing the 1.3.2 beta cut
I got a nil index error in makeParadoxClone() while try to index on
getInven("INVEN"). My character did have an inventory, so this seems
strange. Anyway, it makes sense to check whether INVEN exists before
trying to skip it.

Now, the function checks whether INVEN exists before adding it to the
alt_nodes table.

This should be pushed to 1.3.2.
parents 6e151e76 f15e34b2
No related branches found
No related tags found
No related merge requests found
......@@ -293,7 +293,7 @@ makeParadoxClone = function(self, target, duration, alt_nodes)
-- Don't copy certain fields from the target
alt_nodes = alt_nodes or {}
alt_nodes[target:getInven("INVEN")] = false -- Skip main inventory; equipped items are still copied
if target:getInven("INVEN") then alt_nodes[target:getInven("INVEN")] = false end -- Skip main inventory; equipped items are still copied
alt_nodes.quests = false
alt_nodes.random_escort_levels = false
alt_nodes.achievements = false
......@@ -325,7 +325,6 @@ makeParadoxClone = function(self, target, duration, alt_nodes)
local m = target:cloneCustom(alt_nodes)
-- Basic setup
m.dead = false
m.no_drops = true
m.keep_inven_on_death = false
m.faction = target.faction
......
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