Mercurial > mm7
diff 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 |
line wrap: on
line diff
--- a/Player.cpp Wed Oct 09 08:39:49 2013 +0200 +++ b/Player.cpp Wed Oct 09 09:08:15 2013 +0200 @@ -1240,7 +1240,7 @@ Player::Player() { memset(&pEquipment, 0, sizeof(PlayerEquipment)); - memset(pInventoryMatrix, 0, 126 * sizeof(int)); + memset(pInventoryMatrix.data(), 0, 126 * sizeof(int)); for (uint i = 0; i < 126; ++i) pInventoryItemList[i].Reset(); for (uint i = 0; i < 12; ++i) @@ -1260,7 +1260,7 @@ pName[0] = 0; uCurrentFace = 0; uVoiceID = 0; - memset(pConditions, 0, 20 * sizeof(__int64)); + memset(pConditions.data(), 0, 20 * sizeof(__int64)); field_BB = 0; @@ -1308,7 +1308,7 @@ _mana_related = 0; uQuickSpell = 0; - memset(pInstalledBeacons, 0, 5 * sizeof(LloydBeacon)); + memset(pInstalledBeacons.data(), 0, 5 * sizeof(LloydBeacon)); _some_attack_bonus = 0; field_1A91 = 0; @@ -3964,7 +3964,7 @@ uLevel = 1; uExperience = 251 + rand() % 100; uBirthYear = 1147 - rand() % 6; - memset(pActiveSkills, 0, sizeof(pActiveSkills)); + memset(pActiveSkills.data(), 0, sizeof(pActiveSkills)); memset(_achieved_awards_bits, 0, 64); memset(&spellbook, 0, sizeof(PlayerSpells)); @@ -7977,4 +7977,5 @@ else if ( this == pPlayers[4] ) uPlayerIdx = 3; Error("Unexpected player pointer"); + return uPlayerIdx; } \ No newline at end of file