Commit e5a74166bda8c802b0ee1a2a6fef8cf89e09e5f0

Authored by DarkGod
2 parents 6e151e76 f15e34b2

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.
... ... @@ -293,7 +293,7 @@ makeParadoxClone = function(self, target, duration, alt_nodes)
293 293
294 294 -- Don't copy certain fields from the target
295 295 alt_nodes = alt_nodes or {}
296   - alt_nodes[target:getInven("INVEN")] = false -- Skip main inventory; equipped items are still copied
  296 + if target:getInven("INVEN") then alt_nodes[target:getInven("INVEN")] = false end -- Skip main inventory; equipped items are still copied
297 297 alt_nodes.quests = false
298 298 alt_nodes.random_escort_levels = false
299 299 alt_nodes.achievements = false
... ... @@ -325,7 +325,6 @@ makeParadoxClone = function(self, target, duration, alt_nodes)
325 325 local m = target:cloneCustom(alt_nodes)
326 326
327 327 -- Basic setup
328   - m.dead = false
329 328 m.no_drops = true
330 329 m.keep_inven_on_death = false
331 330 m.faction = target.faction
... ...