From 37f9f885db6119b88044f55091fa0068f135c3ea Mon Sep 17 00:00:00 2001 From: Frederick Martian Date: Fri, 10 Sep 2010 11:05:45 +0200 Subject: When buying land check the maturity level first and inform the agent when the land does have a higher level than what he is currently set to --- linden/indra/newview/llviewerparcelmgr.cpp | 14 +++++++++++++- .../newview/skins/default/xui/en-us/notifications.xml | 9 +++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index 21fca25..61b91fe 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -1071,7 +1071,19 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( LLNotifications::instance().add("CannotBuyLandNoRegion"); return NULL; } - + + /* Check for maturity being not higher than the current users ability and preference. */ + U8 sim_access = region->getSimAccess(); + const LLAgentAccess& agent_access = gAgent.getAgentAccess(); + // if the region is PG, we're happy already, so do nothing + // but if we're set to avoid either mature or adult, get us outta here + if (((sim_access == SIM_ACCESS_MATURE) && !agent_access.canAccessMature()) || + ((sim_access == SIM_ACCESS_ADULT) && !agent_access.canAccessAdult())) + { + LLNotifications::instance().add("CannotBuyLandMaturity"); + return NULL; + } + if (is_claim) { llinfos << "Claiming " << mWestSouth << " to " << mEastNorth << llendl; diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index eced647..9ebeec9 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -1729,6 +1729,15 @@ Cannot find the region this land is in. +Unable to buy land: + +Your allowed or prefered maturity level does not allow to buy this land. + + + You cannot close the Buy Land window until [GRID_NAME] estimates the price of this transaction. -- cgit v1.1