--- deliantra/server/common/map.C 2009/10/16 01:19:12 1.164 +++ deliantra/server/common/map.C 2009/10/20 05:57:08 1.165 @@ -116,51 +116,39 @@ */ for (object *tmp = ms.bot; tmp; tmp = tmp->above) { - bool block = OB_MOVE_BLOCK (ob, tmp); - - /* This must be before the checks below. Code for inventory checkers. */ - if (block && tmp->type == CHECK_INV) + if (OB_MOVE_BLOCK (ob, tmp)) { - bool have = check_inv_recursive (ob, tmp); - - /* If last_sp is set, the player/monster needs an object, - * so we check for it. If they don't have it, they can't - * pass through this space. - */ - if (tmp->last_sp) + if (tmp->type == CHECK_INV) { - if (!have) + bool have = check_inv_recursive (ob, tmp); + + // last_sp set means we block if we don't have. + if (logical_xor (have, tmp->last_sp)) return 1; } - else + else if (tmp->type == T_MATCH) { - /* In this case, the player must not have the object - - * if they do, they can't pass through. - */ - if (have) + // T_MATCH allows "entrance" iff the match is true + // == blocks if the match fails + + // we could have used an INVOKE_OBJECT, but decided against it, as we + // assume that T_MATCH is very common. + if (!match (tmp->slaying, ob, tmp, ob)) return 1; } - } - else if (block && tmp->type == T_MATCH) - { - //TODO - } - else - { - /* Broke apart a big nasty if into several here to make - * this more readable. first check - if the space blocks - * movement, can't move here. - * second - if a monster, can't move there, unless it is a - * dm. - */ - if (block) - return 1; + else + return 1; // unconditional block + + } else { + // space does not block the ob, directly, but + // anything alive that is not a door still + // blocks anything but wizards. if (tmp->flag [FLAG_ALIVE] && tmp->head_ () != ob && tmp != ob && tmp->type != DOOR - && !tmp->flag [FLAG_WIZ]) + && !tmp->flag [FLAG_WIZPASS]) return 1; } }