Allow customizing subterranean movement speed and allow parsing floating point Speed values
This should fix an issue introduced in 890eca0cd7eeb9298e876386cb2c3787bfb3e72b for tunnel locomotor where a distance check was made against unit's current speed without ensuring that SpeedPercentage which is normally not used by TunnelLocomotionClass is 1.0 instead of 0.0 and unhardcoding the subterranean movement speed.
Subterranean unit travel speed
- Subterranean movement speed is now customizable, both globally and per TechnoType. If per-TechnoType value is negative, global value is used. This does not affect the speed at which the unit moves vertically when burrowing which is determined by
Speedmultiplied by[General]->TunnelSpeed.
In rulesmd.ini:
[General]
SubterraneanSpeed=7.5 ; floating point value
[SOMETECHNO] ; TechnoType
SubterraneanSpeed=-1 ; floating point value
Unit Speed setting now accepts floating-point values. Internally parsed values are clamped down to maximum of 100, multiplied by 256 and divided by 100, the result (which at this point is converted to an integer) then clamped down to maximum of 255 giving effective internal speed value range of 0 to 255, e.g leptons traveled per game frame.
Nightly build for this pull request:
- compiled-dll-daa4fdc561ca63bf72021e5629245c3238a3d332.zip These artifacts will expire in 90 days and will not be available for download after that time.
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.
Fuckery fixed.
But there is one small problem...
This happens only when the unit doesn't burrow. If it the unit will burrow after turning, the graphic doesn't bug out.
This also does not happen if SubterraneanUseSpeed= tags have default value.
This also does not happen if SubterraneanUseSpeed= tags have default value.
It seems it was not this. I cannot reproduce this issue again no matter what SubterraneanUseSpeed= values i use, I have no clue why it happened in the first place, even though all of these units on that animation were affected at once.
Maybe we need another flag like SubterraneanSpeed to control the tunnel speed instead of using the Speed flag directly. Just like JumpjetSpeed.
Changed the movement speed to be customizable individually from regular Speed. The burrowing speed remains tied to regular Speed.