{
for(x = 1; x < this->width * 2 + 1; x += 2)
{
- this->sightPass[y * this->width + x] = (this->GetSquare(x / 2, y / 2)->GetFloorTag() == "VANILLA_PERMANENT_WALL");
- this->physicalPass[y * this->width + x] = (this->GetSquare(x / 2, y / 2)->GetFloorTag() == "VANILLA_PERMANENT_WALL");
+ this->sightPass[y * this->width + x] = !this->GetSquare(x / 2, y / 2)->IsWall();
+ this->physicalPass[y * this->width + x] = !this->GetSquare(x / 2, y / 2)->IsWall();
}
}
{
for(x = 0; x < this->width * 2 + 1; x += 2)
{
- if(this->GetSquare(x / 2 - 1, y / 2 - 1) && this->GetSquare(x / 2 - 1, y / 2 - 1)->GetFloorTag() == "VANILLA_PERMANENT_WALL" ||
- this->GetSquare(x / 2 - 1, y / 2 - 1) && this->GetSquare(x / 2 - 1, y / 2 - 1)->GetFloorTag() == "VANILLA_PERMANENT_WALL" ||
- this->GetSquare(x / 2 - 1, y / 2 - 1) && this->GetSquare(x / 2 - 1, y / 2 - 1)->GetFloorTag() == "VANILLA_PERMANENT_WALL" ||
- this->GetSquare(x / 2 - 1, y / 2 - 1) && this->GetSquare(x / 2 - 1, y / 2 - 1)->GetFloorTag() == "VANILLA_PERMANENT_WALL")
+ if(!this->GetSquare(x / 2 - 1, y / 2 - 1) || !this->GetSquare(x / 2 - 1, y / 2) || !this->GetSquare(x / 2, y / 2 - 1) || !this->GetSquare(x / 2, y / 2))
+ {
+ this->sightPass[y * this->width + x] = false;
+ this->physicalPass[y * this->width + x] = false;
+ }
+ else if(this->GetSquare(x / 2 - 1, y / 2 - 1)->IsWall() || this->GetSquare(x / 2, y / 2 - 1)->IsWall() || this->GetSquare(x / 2 - 1, y / 2)->IsWall() || this->GetSquare(x / 2, y / 2 )->IsWall())
{
this->sightPass[y * this->width + x] = false;
this->physicalPass[y * this->width + x] = false;
}
}
+ for(y = 0; y < this->height * 2 + 1; y += 2)
+ {
+ for(x = 1; x < this->width * 2 + 1; x += 2)
+ {
+ if(!this->GetSquare(x / 2, y / 2 - 1) || !this->GetSquare(x / 2, y / 2))
+ {
+ this->sightPass[y * this->width + x] = false;
+ this->physicalPass[y * this->width + x] = false;
+ }
+ else if(this->GetSquare(x / 2, y / 2 - 1)->IsWall() || this->GetSquare(x / 2, y / 2)->IsWall())
+ {
+ this->sightPass[y * this->width + x] = false;
+ this->physicalPass[y * this->width + x] = false;
+ }
+ else
+ {
+ this->sightPass[y * this->width + x] = true;
+ this->physicalPass[y * this->width + x] = true;
+ }
+ }
+ }
+
+ for(y = 1; y < this->height * 2 + 1; y += 2)
+ {
+ for(x = 0; x < this->width * 2 + 1; x += 2)
+ {
+ if(!this->GetSquare(x / 2 - 1, y / 2) || !this->GetSquare(x / 2, y / 2))
+ {
+ this->sightPass[y * this->width + x] = false;
+ this->physicalPass[y * this->width + x] = false;
+ }
+ else if(this->GetSquare(x / 2 - 1, y / 2)->IsWall() || this->GetSquare(x / 2, y / 2)->IsWall())
+ {
+ this->sightPass[y * this->width + x] = false;
+ this->physicalPass[y * this->width + x] = false;
+ }
+ else
+ {
+ this->sightPass[y * this->width + x] = true;
+ this->physicalPass[y * this->width + x] = true;
+ }
+ }
+ }
}