another divisions quota.
conversion. Rewrote supported missing code needed. [RLB]
* @div/create didn't abide by quotas. Added can_pay_fees()
check to div creatin and added new configuration option
- division_cost.
+ division_cost. [RLB]
+ * Quotas were not being checked properely before a division
+ received objects into their division. [RLB]
void delete_player(dbref player, const char *alias);
/* From predicat.c */
-
+extern int pay_quota(dbref, int);
extern char *WIN32_CDECL tprintf(const char *fmt, ...)
__attribute__ ((__format__(__printf__, 1, 2)));
ATTR *divrcd;
char *p_buf[BUFFER_LEN / 2];
char buf[BUFFER_LEN], *bp;
- dbref divi;
+ dbref cur_obj, divi;
struct power_group_list *pg_l;
int cnt;
return;
}
+
+
if (!strcasecmp(arg2, "NONE")) {
notify(exec, T("Division reset."));
notify(target, T("GAME: Division reset."));
return;
}
+ /* Make sure the receiving division has the quota to receive all of this crapp...
+ */
+
+ if(Typeof(target) == TYPE_PLAYER) {
+ for(cnt = cur_obj = 0; cur_obj < db_top ; cur_obj++)
+ if(Owner(cur_obj) == target && Division(cur_obj) == Division(target))
+ cnt++;
+ } else cnt = 1;
+
+ if(!pay_quota(divi, cnt)) {
+ notify(exec, T("That division does not have the quota required to receive that."));
+ return;
+ }
+
+ if(Division(target))
+ change_quota(Division(target), cnt);
+
if (Typeof(target) == TYPE_PLAYER)
adjust_divisions(target, Division(target), divi);
else
static int grep_helper(dbref player, dbref thing, dbref parent,
char const *pattern, ATTR *atr, void *args);
void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive);
-static int pay_quota(dbref, int);
+int pay_quota(dbref, int);
extern PRIV attr_privs[];
/** A generic function to generate a formatted string. The
* \retval 1 quota successfully debitted.
* \retval 0 not enough quota to debit.
*/
-static int
+int
pay_quota(dbref who, int cost)
{
int curr;