world conquest: fix bezoar artifact being bugged (#6515)
This commit is contained in:
parent
a7755749e3
commit
b541b4cb23
2 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
### Add-ons client
|
||||
### Add-ons server
|
||||
### Campaigns
|
||||
* World Conquest
|
||||
* Fixed Bezoar artifact being bugged and broken.
|
||||
### Editor
|
||||
### Multiplayer
|
||||
### Lua API
|
||||
|
|
|
@ -114,6 +114,14 @@ function artifacts.give_item(unit, index, visualize)
|
|||
unit:add_modification("object", object)
|
||||
--rebuild unit, to reduce savefile size.
|
||||
unit:transform(unit.type)
|
||||
|
||||
-- slot in traits if any artifacts grant any
|
||||
for trait in wml.child_range(artifacts.list[index], "trait") do
|
||||
if not unit:matches { wml.tag.filter_wml { wml.tag.modifications { wml.tag.trait { id = trait.id } } } } then
|
||||
unit:add_modification("trait", trait)
|
||||
end
|
||||
end
|
||||
|
||||
-- restore unit hitpoints to before they picked up the artifact
|
||||
unit.hitpoints = unit_initial_hp
|
||||
-- the artifact might reduce the max xp.
|
||||
|
|
Loading…
Add table
Reference in a new issue