diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
commit | 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch) | |
tree | 62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2PeopleArrayList.cpp | |
parent | c0c336500955a23e344651e5412c9d9d441ef4ee (diff) | |
download | t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip |
i am in hell
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2PeopleArrayList.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/T2DLL/T2PeopleArrayList.cpp b/src/T2DLL/T2PeopleArrayList.cpp index 91b94a6..25e5984 100644 --- a/src/T2DLL/T2PeopleArrayList.cpp +++ b/src/T2DLL/T2PeopleArrayList.cpp @@ -32,10 +32,11 @@ T2PeopleArray* T2PeopleArrayList::GetItemAt(int index) { T2People* T2PeopleArrayList::FindPeople(unsigned int peopleID) { LArrayIterator iterator(*this); + T2People *people; T2PeopleArray *peopleArray; while (iterator.Next(&peopleArray)) { - T2People *people = peopleArray->FindPeople(peopleID); + people = peopleArray->FindPeople(peopleID); if (people) return people; } @@ -112,37 +113,37 @@ void T2PeopleArrayList::AddStress(int v) { } void T2PeopleArrayList::Read(T2Archive& archive, T2TowerDoc* towerDoc) { - int count; - archive >> count; + int numOfPeopleArrays; + archive >> numOfPeopleArrays; RemoveItemsAt(GetCount(), 1); unsigned int startID = 1; - for (int i = 0; i < count; i++) { + for (int i = 0; i < numOfPeopleArrays; i++) { Add(new T2PeopleArray(startID)); startID += 256; } - T2PeopleArray *peopleArray; + T2PeopleArray *thePeopleArray; - LArrayIterator iterator1(*this); - while (iterator1.Next(&peopleArray)) - peopleArray->Read(archive, towerDoc); + LArrayIterator iter(*this); + while (iter.Next(&thePeopleArray)) + thePeopleArray->Read(archive, towerDoc); - LArrayIterator iterator2(*this); - while (iterator2.Next(&peopleArray)) - peopleArray->ResolveLink(this); + LArrayIterator iter2(*this); + while (iter2.Next(&thePeopleArray)) + thePeopleArray->ResolveLink(this); } void T2PeopleArrayList::Write(T2Archive& archive) { - int count = GetItemCount(); - archive << count; + int numOfPeopleArrays = GetItemCount(); + archive << numOfPeopleArrays; LArrayIterator iterator(*this); - T2PeopleArray *peopleArray; + T2PeopleArray *thePeopleArray; - while (iterator.Next(&peopleArray)) - peopleArray->Write(archive); + while (iterator.Next(&thePeopleArray)) + thePeopleArray->Write(archive); } void T2PeopleArrayList::BreakoutEmergency(T2TowerDoc* towerDoc) { |