-
-
Notifications
You must be signed in to change notification settings - Fork 995
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
Invalid [damage_type] [filter_opponent] formula causes silent crash #8522
Comments
semi-related: #8385 |
The alternative_type choose automaticelly the damage type who done more damage but for the weapon applied, here i see what you use formula self[cold] >max[cold] perhaps what you should remove max damage when same type what damage compared |
Oh pardon, i dont undertstand what bug is intentional but not behavior of game when error in formula, have you trier with other weapn special ? |
Like alternative_type select the damage type who done more damage between original and [damage_type]alternative_type= why you encode this in [filter_oppoonent]? |
I have tried several times and the problem is not specific to [damage_type], I don't know why wesnoth crashes without displaying a syntax error message in log files and I don't see how to fix it |
No. No it's not. Crashing is never fine, not even if you've coded something incredibly dumb (which yes, this is). There should always be an error message instead of a crash.
Uhhhhhhh… what on earth are you doing here? The extra closing parenthesis is just the start of the errors in that snippet.
The correct formula would be something like this (assuming no custom damage types are in play):
Though it can never be greater, so you might as well delete the Though obviously all of that is assuming that you want "self" to refer to the opponent and not some random other unit on the map. Still, if you do want "self" to refer to some random other unit on the map, and and |
Yeah, the snippet is very wrong. Right now I've got it all working correctly, I appreciate the notes.
|
I think And as mentioned in the previous comment, the |
Will do, thanks. Much simpler for sure, and I don't mind catching custom damage types. |
I see that you use the alternative_type attribute in [damage_type] but do you know that if you use it instead of replacement_type then you do not need a formula because the resistance comparison is programmed in the source code and alternative_type chosen always the type for which the opponent is least resistant, but in case where you use many [damage_type] difffrent it is make sense. |
if you need to choice the alternative_type in list of many damage_type, then yes use formula for exclude of list used the damage_type who don't matches is a good method, the altenative_type used alone is valable for a only [damage_type] else this isthe [damage_type] in head of list who will be used(the type are classed in alphabétical order by default in damage_type) |
Game and System Information
Description of the bug
Targeting a weapon attack with the following invalid specials causes Wesnoth to crash without an error.
The formula has an extra closing parenthesis, which causes the crash. Crashing is fine, error-less is the bug.
Steps to reproduce the behavior
Expected behavior
Wesnoth should throw an error, recognizing the invalid
formula
syntax.Additional context
No response
The text was updated successfully, but these errors were encountered: