Enumify terrain blockage and generalize the line of sight function

This should probably be two separate commits, but they're tangled together and I don't want to spend the effort to disentangle them.
This commit is contained in:
2014-12-01 19:50:19 -05:00
parent afd45b3774
commit d900c7edef
19 changed files with 150 additions and 300 deletions

View File

@@ -95,7 +95,7 @@ cTerrain& cTerrain::operator = (legacy::terrain_type_type& old){
99,99,99,99,99,2, 99,99,99,99, 99,99,99,99,
};
picture = old.picture;
blockage = old.blockage;
blockage = (eTerObstruct) old.blockage;
if(picture < 260){
combat_arena = arenas[picture];
ground_type = ground[picture];
@@ -365,3 +365,16 @@ std::istream& operator >> (std::istream& in, eTerSpec& e){
else e = TER_SPEC_NONE;
return in;
}
std::ostream& operator << (std::ostream& out, eTerObstruct& e){
return out << (int) e;
}
std::istream& operator >> (std::istream& in, eTerObstruct& e){
int i;
in >> i;
if(i > 0 && i < 6)
e = (eTerObstruct) i;
else e = eTerObstruct::CLEAR;
return in;
}