From 6645273ab33c440d1c6ac118f436b5362b8ba394 Mon Sep 17 00:00:00 2001 From: nveid Date: Sat, 28 Oct 2006 12:36:40 +0000 Subject: [PATCH] Division quota restrictions were not being displayed correctly when using the @quota command. (cherry picked from commit f1a9b6d4451d0715a25a6d6cbecb603942537dd8) --- game/txt/changes/0.72p2 | 2 ++ src/predicat.c | 2 +- src/wiz.c | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/game/txt/changes/0.72p2 b/game/txt/changes/0.72p2 index 39dce78..b6a903c 100644 --- a/game/txt/changes/0.72p2 +++ b/game/txt/changes/0.72p2 @@ -27,3 +27,5 @@ CobraMUSH Version 0.72p2 * Checking info for any attributes would crash the game. [RLB] * @su and @sd Password: prompt didn't handle correctly for clients that did not handle the GOAHEAD prompt telnet code. [RLB] + * Quotas were not accounting Division new quotas restrictions + correctly for display using the @quota command. diff --git a/src/predicat.c b/src/predicat.c index 24749d5..0007f6b 100644 --- a/src/predicat.c +++ b/src/predicat.c @@ -629,7 +629,7 @@ get_current_quota(dbref who) for (i = 0; i < db_top; i++) if (!IsGarbage(i) && ((!IsDivision(who) && Owner(i) == Owner(who)) - || (IsDivision(who) && !IsPlayer(i) && div_inscope(who,i)))) + || (IsDivision(who) && !IsPlayer(i) && IsDivision(Division(i)) && div_inscope(who,i)))) owned++; owned--; /* don't count the player or division itself */ diff --git a/src/wiz.c b/src/wiz.c index b4d2cfb..e49f5f0 100644 --- a/src/wiz.c +++ b/src/wiz.c @@ -154,21 +154,21 @@ do_quota(dbref player, const char *arg1, const char *arg2, int set_q) if (Owner(thing) == who && !IsDivision(who)) { if (!IsGarbage(thing)) ++owned; - } else if(IsDivision(who) && div_inscope(who,thing)) { /* incase we're doing division quotas */ + } else if(IsDivision(who) && IsDivision(Division(thing)) && div_inscope(who,thing) ) { /* incase we're doing division quotas */ if(!IsGarbage(thing) && !IsPlayer(thing)) /* we don't include garbage or player objects in div quotas */ ++owned; } /* And No matter what.. we have to calculate the same info from the division we're in.. */ - if( !IsMasterDivision(Division(who)) && + if( !IsMasterDivision(Division(who)) && !IsGarbage(thing) && !IsPlayer(thing) && IsDivision(Division(thing))&& div_inscope(Division(who), thing)) downed++; } if(!IsMasterDivision(Division(who)) && !NoQuota(Division(who))) - dlimit = get_current_quota(who); + dlimit = get_current_quota(Division(who)); - /* the quotas of priv'ed players are unlimited and cannot be set. */ + /* the quotas of players with the NoQuota power are unlimited and cannot be set. */ if (!USE_QUOTA || NoQuota(who)) { notify_format(player, T("Objects: %d Limit: UNLIMITED"), owned); return; @@ -179,14 +179,14 @@ do_quota(dbref player, const char *arg1, const char *arg2, int set_q) if (!set_q) { limit = get_current_quota(who); - notify_format(player, T("Objects: %d Limit: %d"), owned, (downed + dlimit) > (owned + limit) && dlimit != NOTHING + notify_format(player, T("Objects: %d Limit: %d"), owned, (downed + dlimit) < (owned + limit) && dlimit != NOTHING ? (downed + dlimit) : (owned + limit)); return; } /* set a new quota */ if (!arg2 || !*arg2) { limit = get_current_quota(who); - notify_format(player, T("Objects: %d Limit: %d"), owned, (downed + dlimit) > (owned + limit) && dlimit != NOTHING ? + notify_format(player, T("Objects: %d Limit: %d"), owned, (downed + dlimit) < (owned + limit) && dlimit != NOTHING ? (downed + dlimit) : (owned + limit)); notify(player, T("What do you want to set the quota to?")); return; -- 2.30.2