mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
Added checks to relinquishing land
This commit is contained in:
parent
035edebfb4
commit
b723e092f9
1 changed files with 19 additions and 0 deletions
|
@ -184,6 +184,25 @@ bool Core::HousingMgr::relinquishLand( Entity::Player& player, uint8_t plot )
|
||||||
|
|
||||||
auto pLand = pHousing->getLand( plot );
|
auto pLand = pHousing->getLand( plot );
|
||||||
auto plotMaxPrice = pLand->getCurrentPrice();
|
auto plotMaxPrice = pLand->getCurrentPrice();
|
||||||
|
auto landOwnerId = pLand->getPlayerOwner();
|
||||||
|
|
||||||
|
// can't relinquish when you are not the owner
|
||||||
|
// TODO: actually use permissions here for FC houses
|
||||||
|
if( landOwnerId != player.getId() )
|
||||||
|
{
|
||||||
|
auto msgPkt = makeActorControl143( player.getId(), ActorControl::LogMsg, 3304, 0 );
|
||||||
|
player.queuePacket( msgPkt );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unable to relinquish if there is a house built
|
||||||
|
// TODO: additionally check for yard items
|
||||||
|
if( pLand->getHouse() )
|
||||||
|
{
|
||||||
|
auto msgPkt = makeActorControl143( player.getId(), ActorControl::LogMsg, 3315, 0 );
|
||||||
|
player.queuePacket( msgPkt );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
pLand->setCurrentPrice( pLand->getMaxPrice() );
|
pLand->setCurrentPrice( pLand->getMaxPrice() );
|
||||||
pLand->setPlayerOwner( 0 );
|
pLand->setPlayerOwner( 0 );
|
||||||
|
|
Loading…
Add table
Reference in a new issue