Opened 11 years ago
#2004 new defect
Height offset is not correctly transferred to promoted unit
Reported by: | sanderd17 | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
When a unit gets promoted, the height offset gets transferred from the old model to the new one. But this only works with a relative height offset.
When the offset is fixed (m_RelativeToGround == false in CCmpPosition), the offset gets re-applied as relative to the ground.
To fix it, CCmpPosition would need some changes to be able to do this. With the recent changes to CCmpPosition, I'll wait a bit with the actual implementation to avoid conflicts.
I propose to have the following functions:
void SetHeightOffset(fixed) -> only set the variable "m_YOffset" fixed GetHeightOffset() -> return the variable "m_YOffset" (function unchanged) void SetHeightFixed(boolean) -> Set m_RelativeToGound = !true/!false (function name gets a complete new meaning) boolean GetHeightFixed() -> return !m_RelativeToGround (new function)
With the above changes, Looter.js wouldn't even need to change, and the function names look a lot more logical to me (simple setters and getters should only work on one attribute).
As the meaning of m_RelativeToGround would be the negation of SethHeightFixed and GetHeightFixed, I also propose to rename that variable to m_HeightFixed, and negate the value of it.