mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
Fix issue where housing eobj wouldn't spawn on land build - #448
This commit is contained in:
parent
795c8280d5
commit
86fb678b0c
3 changed files with 18 additions and 4 deletions
|
@ -356,8 +356,7 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
||||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandId(), pLand->getWardNum(), pLand->getTerritoryTypeId() );
|
||||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||||
|
|
||||||
auto eobj = hZone->registerEObj( "entrance", 2002737, 0, 4, pLand->getMapMarkerPosition(), 1.f, 0.f );
|
hZone->registerHouseEntranceEObj( plotNum );
|
||||||
eobj->setHousingLink( plotNum << 8 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::World::Manager::HousingMgr::requestEstateRename( Entity::Player& player, const Common::LandIdent ident )
|
void Sapphire::World::Manager::HousingMgr::requestEstateRename( Entity::Player& player, const Common::LandIdent ident )
|
||||||
|
|
|
@ -69,8 +69,7 @@ bool Sapphire::HousingZone::init()
|
||||||
|
|
||||||
if( auto house = pLand->getHouse() )
|
if( auto house = pLand->getHouse() )
|
||||||
{
|
{
|
||||||
auto eobj = registerEObj( "entrance", 2002737, 0, 4, pLand->getMapMarkerPosition(), 1.f, 0.f );
|
registerHouseEntranceEObj( landId << 8 );
|
||||||
eobj->setHousingLink( landId << 8 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,3 +230,17 @@ Sapphire::LandPtr Sapphire::HousingZone::getLand( uint8_t id )
|
||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Sapphire::Entity::EventObjectPtr Sapphire::HousingZone::registerHouseEntranceEObj( uint8_t plotId )
|
||||||
|
{
|
||||||
|
auto land = getLand( plotId );
|
||||||
|
assert( land );
|
||||||
|
|
||||||
|
auto eObj = Entity::make_EventObject( getNextEObjId(), 2002737, 0, 4, land->getMapMarkerPosition(), 0.f, "entrance" );
|
||||||
|
eObj->setHousingLink( plotId << 8 );
|
||||||
|
eObj->setScale( 1.f );
|
||||||
|
|
||||||
|
registerEObj( eObj );
|
||||||
|
|
||||||
|
return eObj;
|
||||||
|
}
|
|
@ -50,6 +50,8 @@ namespace Sapphire
|
||||||
uint32_t getLandSetId() const;
|
uint32_t getLandSetId() const;
|
||||||
Sapphire::LandPtr getLand( uint8_t id );
|
Sapphire::LandPtr getLand( uint8_t id );
|
||||||
|
|
||||||
|
Entity::EventObjectPtr registerHouseEntranceEObj( uint8_t plotId );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
||||||
const uint32_t m_landSetMax = 18;
|
const uint32_t m_landSetMax = 18;
|
||||||
|
|
Loading…
Add table
Reference in a new issue