Skip to content

Commit

Permalink
fix addSynergy (#203)
Browse files Browse the repository at this point in the history
* fix addSynergy

* fix addSynergy

---------

Co-authored-by: haomingfeng <[email protected]>
  • Loading branch information
VictorECDSA and haomingfeng authored Dec 13, 2023
1 parent 439c3d6 commit b3b02d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/contracts/src/systems/PieceInitializerSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ contract PieceInitializerSystem is System {
for (uint256 i; i < RACE_NUMBER; ++i) {
uint256 count = _counter & mask;
RaceSynergyEffectData memory data;
if (count / (4 * base) > 0) {
if (count >= 4 * base) {
data = RaceSynergyEffect.get(4 * base);
} else if (count / (2 * base) > 0) {
}
if (data.effect <= 0 && count >= 2 * base) {
data = RaceSynergyEffect.get(2 * base);
}
if (data.effect > 0) {
Expand All @@ -141,9 +142,10 @@ contract PieceInitializerSystem is System {
for (uint256 i; i < CLASS_NUMBER; ++i) {
uint256 count = _counter & mask;
ClassSynergyEffectData memory data;
if (count / (4 * base) > 0) {
if (count >= 4 * base) {
data = ClassSynergyEffect.get(4 * base);
} else if (count / (2 * base) > 0) {
}
if (data.effect <= 0 && count >= 2 * base) {
data = ClassSynergyEffect.get(2 * base);
}
if (data.effect > 0) {
Expand Down

0 comments on commit b3b02d9

Please sign in to comment.