From 328879ebe6f49f96ba8bb42d431f90bb87782e41 Mon Sep 17 00:00:00 2001 From: nveid Date: Sat, 7 Oct 2006 05:48:29 +0000 Subject: [PATCH] divisioncosts - adjust divisions so they abide by normal quotas rule, and added the division_cost configuration variable. Default cost for creating a division is now 1. (cherry picked from commit 6f18b869c311df030fe8e05278ad5f6d2b1de724) --- game/txt/changes/0.72p2 | 3 +++ hdrs/conf.h | 2 ++ src/conf.c | 3 +++ src/division.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/game/txt/changes/0.72p2 b/game/txt/changes/0.72p2 index ad02b50..d816af5 100644 --- a/game/txt/changes/0.72p2 +++ b/game/txt/changes/0.72p2 @@ -14,3 +14,6 @@ CobraMUSH Version 0.72p2 script. Removed as to acknowledge its non-existance. [RLB] * Program environment code was partially dropped in darcs 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. diff --git a/hdrs/conf.h b/hdrs/conf.h index fe98684..2bbd23c 100644 --- a/hdrs/conf.h +++ b/hdrs/conf.h @@ -235,6 +235,7 @@ struct options_table { char names_file[256]; /**< Name of file of forbidden player names */ int object_cost; /**< Cost to create an object */ int exit_cost; /**< Cost to create an exit */ + int division_cost; /**< Cost to create a division */ int link_cost; /**< Cost to link an exit */ int room_cost; /**< Cost to dig a room */ int queue_cost; /**< Deposit to queue a command */ @@ -384,6 +385,7 @@ int cf_time(const char *opt, const char *val, void *loc, int maxval, #define ROOM_COST (options.room_cost) #define LINK_COST (options.link_cost) #define EXIT_COST (options.exit_cost) +#define DIVISION_COST (options.division_cost) #define OBJECT_COST (options.object_cost) #define GOD ((dbref) 1) #define ANNOUNCE_CONNECTS (options.announce_connects) diff --git a/src/conf.c b/src/conf.c index 8004144..76e4771 100644 --- a/src/conf.c +++ b/src/conf.c @@ -449,6 +449,8 @@ COBRA_CONF conftable[] = { , {"exit_cost", cf_int, &options.exit_cost, 10000, 0, "costs"} , + {"division_cost", cf_int, &options.division_cost, 10000, 0, "costs"} + , {"link_cost", cf_int, &options.link_cost, 10000, 0, "costs"} , {"room_cost", cf_int, &options.room_cost, 10000, 0, "costs"} @@ -1175,6 +1177,7 @@ conf_default_set(void) strcpy(options.names_file, "names.cnf"); options.object_cost = 10; options.exit_cost = 1; + options.division_cost = 1; options.link_cost = 1; options.room_cost = 10; options.queue_cost = 10; diff --git a/src/division.c b/src/division.c index f73f446..baddd95 100644 --- a/src/division.c +++ b/src/division.c @@ -1546,6 +1546,9 @@ create_div(dbref owner, const char *name) char buf[BUFFER_LEN]; dbref obj, loc; + if(!can_pay_fees(owner, DIVISION_COST)) + return; + if (!div_powover(owner, owner, "Division")) { notify(owner, T(e_perm)); return NOTHING; -- 2.30.2