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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user