Crash starting Legend of the Invincibles
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
-
- Posts: 196
- Joined: June 3rd, 2009, 11:37 am
- Contact:
Re: Crash starting Legend of the Invincibles
just started LotI part 2
Either way it looks that such unit crashes wesnoth
Either way it looks that such unit crashes wesnoth
Re: Crash starting Legend of the Invincibles
It doesn't happen if I load an autosave. Starting part 2 causes the error to happen, I can replicate it. I'll have a look at it.
Re: Crash starting Legend of the Invincibles
Line 807 in src/units/unit.cpp must be edited from:
to:
When I do it, the error no longer appears. Can someone with commit rights push it, please?
Code: Select all
name_ = race_->generate_name(gender_);
Code: Select all
if (race_ != &(unit_race::null_race)) name_ = race_->generate_name(gender_);
Re: Crash starting Legend of the Invincibles
I suspect, from a cursory glance at the code, that the proper fix would actually be to make unit_race::generator() avoid dereferencing name_generator_ items that are actually null pointers, or make the default unit_race constructor initialize the contents of name_generator_ to valid pointers instead of leaving it default-constructed.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
- Celtic_Minstrel
- Developer
- Posts: 2222
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Crash starting Legend of the Invincibles
There's a pull request currently pending that touches the name generators (I think it's 661). I think it might fix the issue if this is caused by dereferencing a null name generator like shadowm suggests. And if it doesn't fix it I think I'd prefer to resolve that PR before looking at this issue.
Re: Crash starting Legend of the Invincibles
Wouldn't a temporary solution be better? All fake units have null race, which means that any WML that uses fake units will cause assertion failures. The fix is trivial.
- Celtic_Minstrel
- Developer
- Posts: 2222
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Crash starting Legend of the Invincibles
Hmm. Thinking more on it, the fix you mentioned won't conflict with said pull request, at least. What shadowm said about possible better ways to fix this still applies, though; skipping name generation if the generator is a null pointer makes the most sense to me. Is it really so urgent that a temporary solution is needed? If people want to play Legend of the Invincibles before this is fixed, they can use 1.12.6 or 1.13.4 instead of master, after all. I can implement what I said (or what you said) if there's lots of demand for it, but I just don't see the urgency when it's most likely going to be fixed by PR661 (which eliminates null name generators).
Re: Crash starting Legend of the Invincibles
It's an error that can happen only for those who compile it themselves, so I guess these people are skilled enough to find this topic and the proposed fix.
That PR661 appears like something that's going to be merged soon, so I guess that there's no point in pushing this fix when it will be pointless in a few days anyway.
That PR661 appears like something that's going to be merged soon, so I guess that there's no point in pushing this fix when it will be pointless in a few days anyway.