Skip to content

Commit 9a28d84

Browse files
committed
Reset constructor upgrade between games.
If starting a T3 game, leaving the game, and joining a T1 game, the player would have an 18% construction speed advantage over the other players. Changelog: Fix construction speed upgrades being preserved even between games.
1 parent 61a79c7 commit 9a28d84

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/stats.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ void statsInitVars(void)
163163
numSpecialAbility = 0;
164164

165165
//initialise the upgrade structures
166-
memset(asWeaponUpgrade, 0, MAX_PLAYERS * WSC_NUM_WEAPON_SUBCLASSES * sizeof(WEAPON_UPGRADE));
167-
memset(asSensorUpgrade, 0, MAX_PLAYERS * sizeof(SENSOR_UPGRADE));
168-
memset(asECMUpgrade, 0, MAX_PLAYERS * sizeof(ECM_UPGRADE));
169-
memset(asRepairUpgrade, 0, MAX_PLAYERS * sizeof(REPAIR_UPGRADE));
170-
memset(asBodyUpgrade, 0, MAX_PLAYERS * sizeof(BODY_UPGRADE) * BODY_TYPE);
166+
memset(asWeaponUpgrade, 0, sizeof(asWeaponUpgrade));
167+
memset(asSensorUpgrade, 0, sizeof(asSensorUpgrade));
168+
memset(asECMUpgrade, 0, sizeof(asECMUpgrade));
169+
memset(asRepairUpgrade, 0, sizeof(asRepairUpgrade));
170+
memset(asConstUpgrade, 0, sizeof(asConstUpgrade));
171+
memset(asBodyUpgrade, 0, sizeof(asBodyUpgrade));
171172

172173
// init the max values
173174
maxComponentWeight = maxBodyArmour = maxBodyPower =

0 commit comments

Comments
 (0)