Jump to content

Bug: elite and advanced unit stats are the same if both are present


WhiteTreePaladin
 Share

Recommended Posts

I've noticed something interesting (It's a problem Michael mentioned earlier.)

If there are both advanced and elite units on a map, the elite units will have the same stats as the advanced version. The elite version will have the correct icon though - which is referenced in the elite template.

On the Latium map, there are only elite (and basic if you train them) units available. They both have the correct stats there.

Link to comment
Share on other sites

I noticed another bug with under-construction buildings starting with full HP, and it turns out it's the same as this. When an entity template first gets used by a script, the engine caches the result of converting the template to a JS object, and it assumed templates were never modified so it was safe to cache that forever. It's true that templates aren't modified directly, but with inheritance they are copied and then modified (adding the child's data to the parent's) and it was copying and reusing the old cached JS object. So if an entity inherited from another entity which was loaded earlier, it would get the old entity's stats.

Fixed locally; I'll commit soonish.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...