comparison Player.cpp @ 1826:bdac32c645c5

Changing arrays in class Player to std::array
author Grumpy7
date Wed, 09 Oct 2013 09:08:15 +0200
parents 23deb6b09c8c
children 0c75c3e7e436
comparison
equal deleted inserted replaced
1825:23deb6b09c8c 1826:bdac32c645c5
1238 1238
1239 //----- (0048C6AF) -------------------------------------------------------- 1239 //----- (0048C6AF) --------------------------------------------------------
1240 Player::Player() 1240 Player::Player()
1241 { 1241 {
1242 memset(&pEquipment, 0, sizeof(PlayerEquipment)); 1242 memset(&pEquipment, 0, sizeof(PlayerEquipment));
1243 memset(pInventoryMatrix, 0, 126 * sizeof(int)); 1243 memset(pInventoryMatrix.data(), 0, 126 * sizeof(int));
1244 for (uint i = 0; i < 126; ++i) 1244 for (uint i = 0; i < 126; ++i)
1245 pInventoryItemList[i].Reset(); 1245 pInventoryItemList[i].Reset();
1246 for (uint i = 0; i < 12; ++i) 1246 for (uint i = 0; i < 12; ++i)
1247 pEquippedItems[i].Reset(); 1247 pEquippedItems[i].Reset();
1248 1248
1258 } 1258 }
1259 1259
1260 pName[0] = 0; 1260 pName[0] = 0;
1261 uCurrentFace = 0; 1261 uCurrentFace = 0;
1262 uVoiceID = 0; 1262 uVoiceID = 0;
1263 memset(pConditions, 0, 20 * sizeof(__int64)); 1263 memset(pConditions.data(), 0, 20 * sizeof(__int64));
1264 1264
1265 field_BB = 0; 1265 field_BB = 0;
1266 1266
1267 uMight = uMightBonus = 0; 1267 uMight = uMightBonus = 0;
1268 uIntelligence = uIntelligenceBonus = 0; 1268 uIntelligence = uIntelligenceBonus = 0;
1306 sMana = 0; 1306 sMana = 0;
1307 uFullManaBonus = 0; 1307 uFullManaBonus = 0;
1308 _mana_related = 0; 1308 _mana_related = 0;
1309 1309
1310 uQuickSpell = 0; 1310 uQuickSpell = 0;
1311 memset(pInstalledBeacons, 0, 5 * sizeof(LloydBeacon)); 1311 memset(pInstalledBeacons.data(), 0, 5 * sizeof(LloydBeacon));
1312 1312
1313 _some_attack_bonus = 0; 1313 _some_attack_bonus = 0;
1314 field_1A91 = 0; 1314 field_1A91 = 0;
1315 _melee_dmg_bonus = 0; 1315 _melee_dmg_bonus = 0;
1316 field_1A93 = 0; 1316 field_1A93 = 0;
3962 uIntelligenceBonus = 0; 3962 uIntelligenceBonus = 0;
3963 uMightBonus = 0; 3963 uMightBonus = 0;
3964 uLevel = 1; 3964 uLevel = 1;
3965 uExperience = 251 + rand() % 100; 3965 uExperience = 251 + rand() % 100;
3966 uBirthYear = 1147 - rand() % 6; 3966 uBirthYear = 1147 - rand() % 6;
3967 memset(pActiveSkills, 0, sizeof(pActiveSkills)); 3967 memset(pActiveSkills.data(), 0, sizeof(pActiveSkills));
3968 memset(_achieved_awards_bits, 0, 64); 3968 memset(_achieved_awards_bits, 0, 64);
3969 memset(&spellbook, 0, sizeof(PlayerSpells)); 3969 memset(&spellbook, 0, sizeof(PlayerSpells));
3970 3970
3971 for (uint i = 0; i < 37; ++i) 3971 for (uint i = 0; i < 37; ++i)
3972 { 3972 {
7975 else if ( this == pPlayers[3] ) 7975 else if ( this == pPlayers[3] )
7976 uPlayerIdx = 2; 7976 uPlayerIdx = 2;
7977 else if ( this == pPlayers[4] ) 7977 else if ( this == pPlayers[4] )
7978 uPlayerIdx = 3; 7978 uPlayerIdx = 3;
7979 Error("Unexpected player pointer"); 7979 Error("Unexpected player pointer");
7980 } 7980 return uPlayerIdx;
7981 }