--- deliantra/server/server/apply.C 2010/04/06 04:28:48 1.248 +++ deliantra/server/server/apply.C 2010/04/06 21:11:49 1.249 @@ -32,13 +32,11 @@ #include -typedef bitset types_t; - // these must be in the inventory before they can be applied -static const struct may_attempt_inv : types_t +static const struct apply_types_inv_only : typeset { - may_attempt_inv () + apply_types_inv_only () { set (WEAPON); set (ARMOUR); @@ -61,13 +59,13 @@ set (BUILDER); set (SKILL_TOOL); } -} may_attempt_inv; +} apply_types_inv_only; // these only make sense for the player -static const struct may_attempt_player : types_t +static const struct apply_types_player_only : typeset { - may_attempt_player () + apply_types_player_only () { set (EXIT); set (BOOK); @@ -84,15 +82,15 @@ set (SIGN); set (BOOK); } -} may_attempt_player; +} apply_types_player_only; // applying these _can_ be attempted, others cannot // be applied at all. used by e.g. apply below. -static const struct may_attempt : types_t +static const struct apply_types : typeset { - may_attempt () - : types_t ((types_t)may_attempt_player | (types_t)may_attempt_inv) + apply_types () + : typeset ((typeset)apply_types_player_only | (typeset)apply_types_inv_only) { set (T_HANDLE); set (TRIGGER); @@ -109,7 +107,7 @@ set (POWER_CRYSTAL); set (ITEM_TRANSFORMER); } -} may_attempt; +} apply_types; /**************************************************************************** * Weapon improvement code follows @@ -3405,7 +3403,7 @@ if (INVOKE_OBJECT (APPLY, op, ARG_OBJECT (who))) return RESULT_INT (0); - else if (may_attempt_inv [op->type]) + else if (apply_types_inv_only [op->type]) { // special item, using slot system, needs to be in inv if (op->env == who) @@ -3413,9 +3411,9 @@ who->failmsg (format ("You must get it first! H\n", query_name (op))); } - else if (!who->contr && may_attempt_player [op->type]) + else if (!who->contr && apply_types_player_only [op->type]) return 0; // monsters shouldn't try to apply player-only stuff - else if (may_attempt [op->type]) + else if (apply_types [op->type]) { // ordinary stuff, may be on the floor switch (op->type) @@ -3581,7 +3579,7 @@ // first try to apply "applyables" for (object *tmp = top; tmp; tmp = tmp->below) // the tmp->cb is a hack to allow user-extendable types... - if (!tmp->invisible && (may_attempt [tmp->type] || tmp->cb)) + if (!tmp->invisible && (apply_types [tmp->type] || tmp->cb)) { // If it is visible, player can apply it. pl->apply (tmp);