update sum_param of MSG_SELECT_SUM #493
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix Fluorohydride/ygopro-scripts#1785
Problem:
Some cards have 2 levels when using them as material, such as Tuningware.
The implement of
Group.CheckWithSum...
orGroup.SelectWithSum...
function use oneunsigned int32
to handle this, use 16 bit of this param to store the normal level, and another 16 bit to store the another level:https://github.com/Fluorohydride/ygopro-scripts/blob/master/c92676637.lua#L25
ygopro-core/field.cpp
Lines 2871 to 2872 in bf2339c
This will work for level because as most times the level of one monster won't reach the limit of 16 bit, which is 65535, let alone when using as material.
But attack & defense may go beyond the limit.
Solution:
No monster need 2 attack values to calc sum. So we can use the first bit of
opParam
as mark, if it is 1, treat the other 31 bit ofopParam
as the value.