-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a checking bad phrase structure #1555
base: dev
Are you sure you want to change the base?
Conversation
@Xottab-DUTY But I’m not sure if this check should be removed from the MASTER_GOLD? |
185ec2e
to
495bbe4
Compare
Ah, I forgot that checks are disabled in MASTER_GOLD... |
495bbe4
to
c2d4f9e
Compare
@ChugunovRoman, please, make it not crash. Prefer robustness and always try not to crash instead of using R_ASSERT. |
c2d4f9e
to
6e13116
Compare
I returned the VERIFY |
I believe what @Xottab-DUTY is trying to say that it would be even better if we didn't crash at all. So instead of an if (_vertex)
{
Msg(make_string("! Dublicate phrase ID: [%s] for phrase: [%s]. Existed phrase by this ID: [%s]", phrase_id.c_str(), text, _vertex->data()->GetText()));
return;
} Which would give mod makers and player a better message to understand what exactly the problem is and where but not crash the game. Although you may need to change to function to return a bool and also add an early return in the calling functions. |
@AMS21 There will be no crash in the release build. Because VERIFY is used. And in the debug assembly needs such crash because, allow you to catch an error in a timely manner and fix it. I would to keep the VERIFY. |
But why |
Now if the game doesn’t crash, it’s probably worth returning this check. |
6e13116
to
6311e26
Compare
I don't think my point here is really getting across, but it's not too important and might also be a me problem. Sorry for all the confusion 😓 I do think in essence this is a good addition. |
143d1ca
to
118d39d
Compare
5b2ec76
to
6fffce9
Compare
e89fcc8
to
f6fd5cc
Compare
This verify checks for an already existing phrase added with the same ID, which is an incorrect dialog structure. Each new phrase must have a unique identifier. This check is simply more informative than just
m_edges.end() == std::find(m_edges.begin(), m_edges.end(), vertex->vertex_id())
. The following crash will immediately follow:The new verify: