Closed MarkMcWire closed 2 years ago
Widelands 1.0 has very limited support for replacing units. __replace_if_exists
and friends have been added more recently, so this appears to work fine in current master (at least I can't reproduce the problem there with euro 2.9.5) but not in v1.0.
The only way around this is to disable this particular feature in your add-on for users who are on v1.0. See the-x-mod add-on for an example how to check which version the user has:
N = (get_build_id():find("1.0") ~= 1)
N
is then false
for v1.0 and true
for everything newer.
The register.lua
files would look something like this:
if N then
return {
barleyfield_harvested = { "field", "__replace_if_exists" }
}
else
return {}
end
Or you could just require v1.1 or newer for the Europeans add-on, depending on how much effort you want to put into backwards compatibility.
I no longer change the 2.x versions of the Europeans. Starting with version 3.x they will be backwards compatible. In 3 days I will be version 3.0.0. publish.
Starting with 3.0.0 the issue is solved.
The message from above is from private message from forum from another user.
The background is that I added new growth time values for crops because the values from the game don't fit my economy. For expample barley growth way to slow, so there is a bottleneck in europeans brewery.
I added an extra
, "__replace_if_exists"
in register.lua, but doesn't seem to work properly.I assumed that the objects are loaded exactly the other way around. So first the default objects from the game and then those from the addon.