From 793d305d9678a7aa902869bbecb1559ba96ac32a Mon Sep 17 00:00:00 2001 From: nveid Date: Thu, 5 Apr 2007 05:51:13 +0000 Subject: [PATCH] Improved how powerbitfields are stored allowing a quicker searches of powers to be performedin comparative searches. (cherry picked from commit 2b0b4ec9739d23d1d1d52f9e85762eabfa5ba249) --- game/txt/changes/0.73 | 2 ++ src/division.c | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/game/txt/changes/0.73 b/game/txt/changes/0.73 index 1fc8e5a..53eefba 100644 --- a/game/txt/changes/0.73 +++ b/game/txt/changes/0.73 @@ -4,6 +4,8 @@ CobraMUSH Version 0.73 interest to the user. (See 'changes entries' for a list of all versions.) + Minor: + * Improved how power bitfields are stored. [RLB] Flags: * LEAVE_BEHIND - When a player leaves the location of someone they're flowing with this flag it unfollows diff --git a/src/division.c b/src/division.c index cfb761d..d0db909 100644 --- a/src/division.c +++ b/src/division.c @@ -650,10 +650,8 @@ powergroup_db_set(dbref executor, dbref player, const char *powergroup, switch (ycode) { case YES: GIVE_DPBIT(player, power->flag_yes); - break; case YESLTE: GIVE_DPBIT(player, power->flag_lte); - break; case YESLT: GIVE_DPBIT(player, power->flag_lt); break; @@ -1040,10 +1038,8 @@ rem_pg_from_player(dbref player, POWERGROUP * powergroup) switch (ycode) { case YES: GIVE_DPBIT(player, power->flag_yes); - break; case YESLTE: GIVE_DPBIT(player, power->flag_lte); - break; case YESLT: GIVE_DPBIT(player, power->flag_lt); break; @@ -1790,10 +1786,8 @@ division_empower(dbref exec, dbref target, const char *arg2) switch (flag) { case YES: GIVE_DPBIT(target, power->flag_yes); - break; case YESLTE: GIVE_DPBIT(target, power->flag_lte); - break; case YESLT: GIVE_DPBIT(target, power->flag_lt); break; @@ -2016,7 +2010,6 @@ adjust_powers(dbref obj, dbref to) switch (plev) { case YESLTE: GIVE_DPBIT(obj, power->flag_lte); - break; case YESLT: GIVE_DPBIT(obj, power->flag_lt); break; @@ -2257,6 +2250,8 @@ convert_object_powers(dbref dbnum, int opbts) if (opbts & pconv_ptab[i].Op) { /* give them the power in its new 'full yes' form */ power = find_power(pconv_ptab[i].Name); GIVE_DPBIT(dbnum, power->flag_yes); + GIVE_DPBIT(dbnum, power->flag_lte); + GIVE_DPBIT(dbnum, power->flag_lt); } if (opbts & IS_GUEST) { -- 2.30.2