Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 47 forks source link

[Feature Request] REGION_FLAG_SHIP like REGION_FLAG_HOUSE #1154

Closed canerksk closed 3 months ago

canerksk commented 1 year ago

It is necessary to write interesting functions to determine whether a character is in the house or not. Wouldn't it be better if we could understand this with a single region flag?

eg;

    dword dwFlags = pMultiDef->m_dwRegionFlags;
    if (IsType(IT_SHIP))
    {
        dwFlags |= REGION_FLAG_SHIP;
    }
    else  if (IsType(IT_MULTI) || IsType(IT_MULTI_CUSTOM))
    {
        dwFlags |= REGION_FLAG_HOUSE;
    }
    else
    {
        dwFlags |= pRegionBack->GetRegionFlags(); // Houses get some of the attribs of the land around it.
    }

The codes here are purely examples. Although many have been tested, some may need to be rewritten.