File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ contract GameEngine is IGameEngine {
1616 error InvalidResults ();
1717 error InvalidEquipment ();
1818
19- uint16 public constant version = 261 ; // v1.5: Unified armor stamina system
19+ uint16 public constant version = 262 ; // v1.6: Fixed stance survival factor bug
2020
2121 struct CalculatedStats {
2222 uint16 maxHealth;
@@ -2058,7 +2058,7 @@ contract GameEngine is IGameEngine {
20582058 uint16 defenderMaxHealth ,
20592059 CalculatedStats memory defenderStats ,
20602060 WeaponStats memory weapon ,
2061- StanceMultiplier memory , /* defenderStance */
2061+ StanceMultiplier memory defenderStance ,
20622062 uint256 seed ,
20632063 uint16 lethalityFactor
20642064 ) private pure returns (bool died ) {
@@ -2086,6 +2086,9 @@ contract GameEngine is IGameEngine {
20862086 // Apply weapon survival factor safely
20872087 survivalChance = (survivalChance * uint256 (weapon.survivalFactor)) / 100 ;
20882088
2089+ // Apply stance survival factor safely
2090+ survivalChance = (survivalChance * uint256 (defenderStance.survivalFactor)) / 100 ;
2091+
20892092 // Cap between min and max
20902093 if (survivalChance < MINIMUM_SURVIVAL_CHANCE) {
20912094 survivalChance = MINIMUM_SURVIVAL_CHANCE;
You can’t perform that action at this time.
0 commit comments