slaw
Software Developer
If you want to be monster was only moving when player is on same floor.
Creature.cpp
Change this:
to this:
Creature.cpp
Change this:
Code:
bool Creature::canSee(const Position& pos) const
{
const Position& myPos = getPosition();
if(myPos.z <= 7)
{
//we are on ground level or above (7 -> 0)
//view is from 7 -> 0
if((pos.z > 7) || (std::abs(myPos.z - pos.z) > 1))
return false;
}
else if(myPos.z >= 8)
{
//we are underground (8 -> 15)
//view is +/- 2 from the floor we stand on
if(std::abs(myPos.z - pos.z) > 1)
return false;
}
int offsetz = myPos.z - pos.z;
if((pos.x >= myPos.x - Map::maxViewportX + offsetz) && (pos.x <= myPos.x + Map::maxViewportX + offsetz) &&
(pos.y >= myPos.y - Map::maxViewportY + offsetz) && (pos.y <= myPos.y + Map::maxViewportY + offsetz))
return true;
return false;
}
Code:
bool Creature::canSee(const Position& pos) const
{
const Position& myPos = getPosition();
if(myPos.z == pos.z)
return true;
return false;
}