mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 22:17:45 +00:00
more ident cleanup
This commit is contained in:
parent
419a61f8ff
commit
1c59eb8f98
4 changed files with 38 additions and 37 deletions
|
@ -1618,8 +1618,7 @@ void Sapphire::Entity::Player::sendZonePackets()
|
|||
state |= HasAetheryte;
|
||||
}
|
||||
|
||||
auto ident = pLand->getLandIdent();
|
||||
setLandFlags( LandFlagsSlot::Private, state, ident.landId, ident.wardNum, ident.territoryTypeId );
|
||||
setLandFlags( LandFlagsSlot::Private, state, pLand->getLandIdent() );
|
||||
}
|
||||
|
||||
sendLandFlags();
|
||||
|
@ -1800,12 +1799,10 @@ bool Sapphire::Entity::Player::isOnEnterEventDone() const
|
|||
return m_onEnterEventDone;
|
||||
}
|
||||
|
||||
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags,
|
||||
int16_t landId, int16_t wardNum, int16_t zoneId )
|
||||
void Sapphire::Entity::Player::setLandFlags( uint8_t flagSlot, uint32_t landFlags, Common::LandIdent ident )
|
||||
{
|
||||
m_landFlags[ flagSlot ].landIdent.landId = landId;
|
||||
m_landFlags[ flagSlot ].landIdent.wardNum = wardNum;
|
||||
m_landFlags[ flagSlot ].landIdent.territoryTypeId = zoneId;
|
||||
m_landFlags[ flagSlot ].landIdent = ident;
|
||||
// todo: leave this in for now but we really need to handle this world id shit properly
|
||||
m_landFlags[ flagSlot ].landIdent.worldId = 67;
|
||||
m_landFlags[ flagSlot ].landFlags = landFlags;
|
||||
m_landFlags[ flagSlot ].unkown1 = 0;
|
||||
|
|
|
@ -765,7 +765,7 @@ namespace Sapphire::Entity
|
|||
|
||||
// Housing Handling
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, int16_t landId, int16_t wardNum, int16_t zoneId );
|
||||
void setLandFlags( uint8_t permissionSet, uint32_t landFlags, Common::LandIdent ident );
|
||||
|
||||
void sendLandFlags();
|
||||
void sendLandFlagsSlot( Common::LandFlagsSlot slot );
|
||||
|
|
|
@ -1006,29 +1006,34 @@ void Sapphire::DebugCommandHandler::housing( char* data, Entity::Player& player,
|
|||
subCommand = params;
|
||||
}
|
||||
|
||||
if( subCommand == "permission" || subCommand == "perm" )
|
||||
{
|
||||
uint8_t permissionSet;
|
||||
sscanf( params.c_str(), "%hhu", &permissionSet );
|
||||
|
||||
if ( permissionSet < 5 )
|
||||
{
|
||||
auto pZone = player.getCurrentZone();
|
||||
if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
||||
{
|
||||
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
||||
if( pHousing )
|
||||
{
|
||||
player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
||||
player.sendLandFlags();
|
||||
}
|
||||
else
|
||||
player.sendDebug( "You aren't in a housing Zone." );
|
||||
}
|
||||
}
|
||||
else
|
||||
player.sendDebug( "PermissionSet out of range." );
|
||||
}
|
||||
// if( subCommand == "permission" || subCommand == "perm" )
|
||||
// {
|
||||
// uint8_t permissionSet;
|
||||
// sscanf( params.c_str(), "%hhu", &permissionSet );
|
||||
//
|
||||
// if ( permissionSet < 5 )
|
||||
// {
|
||||
// auto pZone = player.getCurrentZone();
|
||||
// if( pTeriMgr->isHousingTerritory( pZone->getTerritoryTypeId() ) )
|
||||
// {
|
||||
// auto pHousing = std::dynamic_pointer_cast< HousingZone >( pZone );
|
||||
// if( pHousing )
|
||||
// {
|
||||
// // todo: wat?
|
||||
// Common::LandIdent ident {};
|
||||
// ident.wardNum = pHousing->getWardNum();
|
||||
// ident.territoryTypeId = pHousing->getTerritoryTypeId();
|
||||
//
|
||||
// player.setLandFlags( permissionSet, 0, pHousing->getLandSetId(), ident );
|
||||
// player.sendLandFlags();
|
||||
// }
|
||||
// else
|
||||
// player.sendDebug( "You aren't in a housing Zone." );
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// player.sendDebug( "PermissionSet out of range." );
|
||||
// }
|
||||
else
|
||||
{
|
||||
player.sendDebug( "Unknown sub command." );
|
||||
|
|
|
@ -165,8 +165,7 @@ Sapphire::LandPurchaseResult Sapphire::World::Manager::HousingMgr::purchaseLand(
|
|||
pLand->setState( HouseState::sold );
|
||||
pLand->setLandType( Common::LandType::Private );
|
||||
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, plot,
|
||||
pHousing->getWardNum(), pHousing->getTerritoryTypeId() );
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, pLand->getLandIdent() );
|
||||
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
|
@ -217,7 +216,9 @@ bool Sapphire::World::Manager::HousingMgr::relinquishLand( Entity::Player& playe
|
|||
pLand->setLandType( Common::LandType::none );
|
||||
pLand->updateLandDb();
|
||||
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, 0xFF, 0xFF, 0xFF );
|
||||
Common::LandIdent ident { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
|
||||
player.setLandFlags( LandFlagsSlot::Private, 0x00, ident );
|
||||
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
|
@ -351,9 +352,7 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
|||
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
||||
player.playScene( 0x000B0095, 0, SET_BASE | HIDE_HOTBAR , 0, 1, plotNum, nullptr );
|
||||
|
||||
auto ident = pLand->getLandIdent();
|
||||
|
||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, ident.landId, ident.wardNum, ident.territoryTypeId );
|
||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, pLand->getLandIdent() );
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
||||
hZone->registerHouseEntranceEObj( plotNum );
|
||||
|
|
Loading…
Add table
Reference in a new issue