Misc little bits of housekeeping and stuff

This commit is contained in:
2014-12-10 23:53:50 -05:00
parent 7a7b7f27c3
commit 5bfdb5eafa
14 changed files with 31 additions and 26 deletions

View File

@@ -619,7 +619,8 @@ void cParty::readFrom(std::istream& file){
cPlayer& cParty::operator[](unsigned short n){
if(n > 6) throw std::out_of_range("Attempt to access a player that doesn't exist.");
else if(n == 6) return adven[0]; // TODO: PC #6 should never be accessed, but bounds checking is rarely done, so this is a quick fix.
else if(n == 6)
return adven[0]; // TODO: PC #6 should never be accessed, but bounds checking is rarely done, so this is a quick fix.
return adven[n];
}

View File

@@ -66,6 +66,7 @@ cTown& cTown::operator = (legacy::town_record_type& old){
max_num_monst = old.max_num_monst;
spec_on_entry = old.spec_on_entry;
spec_on_entry_if_dead = old.spec_on_entry_if_dead;
spec_on_hostile = -1;
for(i = 0; i < 8; i++){
timer_spec_times[i] = old.timer_spec_times[i];
timer_specs[i] = old.timer_specs[i];

View File

@@ -787,7 +787,7 @@ void cCurTown::writeTo(std::ostream& file){
file << "INBOAT " << in_boat << '\n';
file << "AT " << p_loc.x << ' ' << p_loc.y << '\n';
file << '\f';
for(int i; i < 115; i++)
for(int i = 0; i < 115; i++)
if(items[i].variety != eItemType::NO_ITEM){
file << "ITEM " << i << '\n';
items[i].writeTo(file);