… | |
… | |
110 | /* We basically go through the stack of objects, and if there is |
110 | /* We basically go through the stack of objects, and if there is |
111 | * some other object that has NO_PASS or FLAG_ALIVE set, return |
111 | * some other object that has NO_PASS or FLAG_ALIVE set, return |
112 | * true. If we get through the entire stack, that must mean |
112 | * true. If we get through the entire stack, that must mean |
113 | * ob is blocking it, so return 0. |
113 | * ob is blocking it, so return 0. |
114 | */ |
114 | */ |
115 | for (object *tmp = ms.bot; tmp; tmp = tmp->above) |
115 | for (object *tmp = ms.top; tmp; tmp = tmp->below) |
116 | { |
116 | { |
117 | if (OB_MOVE_BLOCK (ob, tmp)) |
117 | if (OB_MOVE_BLOCK (ob, tmp)) |
118 | { |
118 | { |
119 | if (INVOKE_OBJECT (BLOCKED_MOVE, tmp, ob)) |
119 | if (INVOKE_OBJECT (BLOCKED_MOVE, tmp, ob)) |
120 | if (RESULT_INT (0)) |
120 | if (RESULT_INT (0)) |
… | |
… | |
144 | return 1; // unconditional block |
144 | return 1; // unconditional block |
145 | |
145 | |
146 | } else { |
146 | } else { |
147 | // space does not block the ob, directly, but |
147 | // space does not block the ob, directly, but |
148 | // anything alive that is not a door still |
148 | // anything alive that is not a door still |
149 | // blocks anything but wizards. |
149 | // blocks anything |
150 | |
150 | |
151 | if (tmp->flag [FLAG_ALIVE] |
151 | if (tmp->flag [FLAG_ALIVE] |
152 | && tmp->head_ () != ob |
|
|
153 | && tmp != ob |
|
|
154 | && tmp->type != DOOR) |
152 | && tmp->type != DOOR |
|
|
153 | && tmp->head_ () != ob) //TODO: maybe move these check up? |
155 | return 1; |
154 | return 1; |
156 | } |
155 | } |
157 | } |
156 | } |
158 | |
157 | |
159 | return 0; |
158 | return 0; |
160 | } |
159 | } |
161 | |
160 | |
162 | /* |
161 | /* |
163 | * Returns qthe blocking object if the given object can't fit in the given |
162 | * Returns the blocking object if the given object can't fit in the given |
164 | * spot. This is meant for multi space objects - for single space objecs, |
163 | * spot. This is meant for multi space objects - for single space objecs, |
165 | * just calling get_map_blocked and checking that against movement type |
164 | * just calling get_map_blocked and checking that against movement type |
166 | * of object. This function goes through all the parts of the multipart |
165 | * of object. This function goes through all the parts of the multipart |
167 | * object and makes sure they can be inserted. |
166 | * object and makes sure they can be inserted. |
168 | * |
167 | * |