mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
added wardMaxNum
This commit is contained in:
parent
7f3583f305
commit
9051ce6f11
2 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,8 @@ class HousingZone : public Zone
|
||||||
|
|
||||||
/* returns current ward number for this zone */
|
/* returns current ward number for this zone */
|
||||||
uint8_t getWardNum() const;
|
uint8_t getWardNum() const;
|
||||||
|
|
||||||
|
const uint32_t m_wardMaxNum = 18;
|
||||||
private:
|
private:
|
||||||
uint8_t m_wardNum;
|
uint8_t m_wardNum;
|
||||||
};
|
};
|
||||||
|
|
|
@ -152,6 +152,7 @@ bool Core::TerritoryMgr::createHosuingTerritories()
|
||||||
auto territoryId = territory.first;
|
auto territoryId = territory.first;
|
||||||
auto territoryInfo = territory.second;
|
auto territoryInfo = territory.second;
|
||||||
uint32_t wardNum;
|
uint32_t wardNum;
|
||||||
|
uint32_t wardMaxNum = 1;
|
||||||
|
|
||||||
if( territoryInfo->name.empty() )
|
if( territoryInfo->name.empty() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -161,7 +162,7 @@ bool Core::TerritoryMgr::createHosuingTerritories()
|
||||||
if( !pPlaceName || pPlaceName->name.empty() || !isHousingTerritory( territoryId ) )
|
if( !pPlaceName || pPlaceName->name.empty() || !isHousingTerritory( territoryId ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for( wardNum = 0; wardNum < 18; wardNum++ )
|
for( wardNum = 0; wardNum < wardMaxNum; wardNum++ )
|
||||||
{
|
{
|
||||||
uint32_t guid = getNextInstanceId();
|
uint32_t guid = getNextInstanceId();
|
||||||
pLog->info( std::to_string( territoryId ) +
|
pLog->info( std::to_string( territoryId ) +
|
||||||
|
@ -174,6 +175,7 @@ bool Core::TerritoryMgr::createHosuingTerritories()
|
||||||
|
|
||||||
auto pHousingZone = make_HousingZone( wardNum, territoryId, guid, territoryInfo->name, pPlaceName->name );
|
auto pHousingZone = make_HousingZone( wardNum, territoryId, guid, territoryInfo->name, pPlaceName->name );
|
||||||
pHousingZone->init();
|
pHousingZone->init();
|
||||||
|
wardMaxNum = pHousingZone->m_wardMaxNum;
|
||||||
|
|
||||||
InstanceIdToZonePtrMap instanceMap;
|
InstanceIdToZonePtrMap instanceMap;
|
||||||
instanceMap[guid] = pHousingZone;
|
instanceMap[guid] = pHousingZone;
|
||||||
|
|
Loading…
Add table
Reference in a new issue