• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Problem Transparenty don't show ground from flor-1

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
hey i have problems with transparenty here is screen
Screen_Shot_03_13_17_at_10_49_AM.png

don't show tiles from floor 7
here is my protocolgame.cpp from serverside
C++:
bool ProtocolGame::CanSee(int x, int y, int z) const
{
#ifdef __DEBUG__
    if(z < 0 || z >= MAP_MAX_LAYERS) {
        std::cout << "WARNING! ProtocolGame::CanSee() Z-value is out of range!" << std::endl;
    }
#endif
    /*underground 8->15*/
    if(player->pos.z > 7 && z < 6 /*8 - 2*/) {
        return false;
    }
    /*ground level and above 7->0*/
    else if(player->pos.z <= 7 && z > 7){
        return false;
    }
    //negative offset means that the action taken place is on a lower floor than ourself
    int offsetz = player->pos.z - z;
    if ((x >= player->pos.x - 8 + offsetz) && (x <= player->pos.x + 9 + offsetz) &&
        (y >= player->pos.y - 6 + offsetz) && (y <= player->pos.y + 7 + offsetz))
        return true;
    return false;
}
 
if you're using otc, would be easier to change i would imagine
i don't know otc though so someone else would have to help you with that
unless you can try to find it yourself and show it so i can look at the code to see if i can help
 
if you're using otc, would be easier to change i would imagine
i don't know otc though so someone else would have to help you with that
unless you can try to find it yourself and show it so i can look at the code to see if i can help
ok now working just remove ground from dat. but still problems on floor 7 to 0 doesnt work

Screen_Shot_03_13_17_at_11_24_AM.png


#edit problems is just from 7 to 6 floor doesnt show transparenty

i think is here client side
C++:
int MapView::calcLastVisibleFloor()
{
    if(!m_multifloor)
        return calcFirstVisibleFloor();

    int z = 7;

    Position cameraPosition = getCameraPosition();
    // this could happens if the player is not known yet
    if(cameraPosition.isValid()) {
        // view only underground floors when below sea level
        if(cameraPosition.z > Otc::SEA_FLOOR)
            z = cameraPosition.z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE;
        else
            z = Otc::SEA_FLOOR;
    }

    if(m_lockedFirstVisibleFloor != -1)
        z = std::max<int>(m_lockedFirstVisibleFloor, z);

    // just ensure the that the floor is in the valid range
    z = stdext::clamp<int>(z, 0, (int)Otc::MAX_Z);
    return z;
}
 
Last edited:
Back
Top