Added negative checks

This commit is contained in:
EmosewaMC
2022-03-30 21:58:59 -07:00
parent e66421d34f
commit 0561f60031
3 changed files with 28 additions and 17 deletions

View File

@@ -41,13 +41,16 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
{
if (PropertyManagementComponent::Instance() == nullptr) return;
if (PropertyManagementComponent::Instance()->Claim(originator->GetObjectID()) == false) {
Game::logger->Log("PropertyVendorComponent", "FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu\n", originator->GetObjectID());
return;
}
GameMessages::SendPropertyRentalResponse(m_Parent->GetObjectID(), 0, 0, 0, 0, originator->GetSystemAddress());
auto* controller = dZoneManager::Instance()->GetZoneControlObject();
controller->OnFireEventServerSide(m_Parent, "propertyRented");
PropertyManagementComponent::Instance()->Claim(originator->GetObjectID());
PropertyManagementComponent::Instance()->SetOwner(originator);