Andrius R. schrieb:
> I would say that hardcoding tribe name is not a best option (as tribes
> are dynamically loaded)
you are absolutely right and of course, the tribe should be dynamically
loaded, so this is just a quick (and dirty) fix, which works, as long as
the tribe "barbarians" is existing. But I haven't the knowledge (cause
I'm not a "real" coder - more someone who inspects code and fixes it ;-)
) to do it more dynamical.
-> But the problem was just more complicated, while Widelands even tried
to handle the translated version of <undefined> as tribe and so even
crashed the Editor, if I tried to change the tribe for a player. And
while tribe "<undefined>" was set for EVERY new tribe, I needed to
change the tribes, because else it will crash Widelands as soon as the
map is loaded as scenario.
So :-), I would be happy if you could fix my code in that way, that it
selects the first found tribe, automatically.
If someone creates a package with totally different tribes, the game
will crash anyway, so perhaps the automatic tribe selection in
singleplayer-menu (in scenariomode) has to be overworked in that way,
that Widelands loads another (-> the first found ) tribe as replacement
for that tribe(s), which were given as Scenariotribe(s) and than
couldn't be found.
-> Just crashing with a "I couldn't find..." doesn't seem to be a good