JakobTischler / MoreRealisticDLCs

A lua/xml project that adds MoreRealistic to the Farming Simulator DLCs
8 stars 0 forks source link

vehicle pack check #81

Closed quadural closed 9 years ago

quadural commented 9 years ago

here is the problem : MoreRealisticDLCs: your MoreRealisticVehicles version (v1.3.10) is too outdated. Update to v1.3.8 or higher. Script will now be aborted!

JakobTischler commented 9 years ago

Damn it, I knew that would happen. I didn't think you'd ever get higher than v1.3.9. The problem lies with the previous versions not being named 1.3.09, for example. My compare function now thinks 1.3.10 is the same as 1.3.1 - which wouldn't be the case if the first would have been named 1.3.01. Anyway, I'll try to find a solution.

quadural commented 9 years ago

maybe it would be ok to "convert" the last part of the string (after the last point) to a number and compare this number ? (the "revision" number)

Another way would be to "weight" each number between each point. Example = 1.3.8 => 1x100000 + 3x1000 + 8x10 = 103080 1.3.10 => 1x100000 + 3x1000 + 10x10 = 103100

I set a 100 difference between each weight to support 2 figures (you can even use a 1000 factor not to be bothered in case there are 3 number to the revision. Example = v1.3.115) We don't want 1.3.11 to be higher than 1.4.0

JakobTischler commented 9 years ago

Yeah, that's what I already started with, using a 1000 factor for each number. So in my case, 1.3.61 becomes 1.003061; and 2.0.0.2 becomes 2.000000002. Not as elegant a function as before, but useable :) Will push in a bit.