mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +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.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
auto eobj = hZone->registerEObj( "entrance", 2002737, 0, 4, pLand->getMapMarkerPosition(), 1.f, 0.f );
|
||||
eobj->setHousingLink( plotNum << 8 );
|
||||
hZone->registerHouseEntranceEObj( plotNum );
|
||||
}
|
||||
|
||||
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() )
|
||||
{
|
||||
auto eobj = registerEObj( "entrance", 2002737, 0, 4, pLand->getMapMarkerPosition(), 1.f, 0.f );
|
||||
eobj->setHousingLink( landId << 8 );
|
||||
registerHouseEntranceEObj( landId << 8 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,4 +229,18 @@ Sapphire::LandPtr Sapphire::HousingZone::getLand( uint8_t id )
|
|||
return nullptr;
|
||||
|
||||
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;
|
||||
Sapphire::LandPtr getLand( uint8_t id );
|
||||
|
||||
Entity::EventObjectPtr registerHouseEntranceEObj( uint8_t plotId );
|
||||
|
||||
private:
|
||||
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
|
||||
const uint32_t m_landSetMax = 18;
|
||||
|
|
Loading…
Add table
Reference in a new issue