mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 16:57:47 +00:00
WiP check permissions before removing the estate hall.
This commit is contained in:
parent
6ef3c0b071
commit
47f449f4e1
1 changed files with 16 additions and 0 deletions
|
@ -1710,6 +1710,22 @@ void HousingMgr::removeHouse( Entity::Player& player, uint16_t plot )
|
||||||
if( !terri )
|
if( !terri )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto& server = Common::Service< World::WorldServer >::ref();
|
||||||
|
auto pSession = server.getSession( player.getCharacterId() );
|
||||||
|
|
||||||
|
auto pLand = terri->getLand( plot );
|
||||||
|
if( !pLand )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// can't remove when you are not the owner
|
||||||
|
// TODO: actually use permissions here for FC houses
|
||||||
|
if( !hasPermission( player, *pLand, 0 ) )
|
||||||
|
{
|
||||||
|
auto msgPkt = makeActorControlSelf( player.getId(), ActorControl::LogMsg, 3305, 0 );
|
||||||
|
pSession->getZoneConnection()->queueOutPacket( msgPkt );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto land = terri->getLand( static_cast< uint8_t >( plot ) );
|
auto land = terri->getLand( static_cast< uint8_t >( plot ) );
|
||||||
if( !land || !land->getHouse() )
|
if( !land || !land->getHouse() )
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue