… | |
… | |
132 | send_changed_object (object *op) |
132 | send_changed_object (object *op) |
133 | { |
133 | { |
134 | object *tmp; |
134 | object *tmp; |
135 | player *pl; |
135 | player *pl; |
136 | |
136 | |
137 | if (op->env != NULL) |
137 | if (op->env) |
138 | { |
138 | { |
139 | tmp = is_player_inv (op->env); |
139 | tmp = op->in_player (); |
|
|
140 | |
140 | if (!tmp) |
141 | if (!tmp) |
141 | { |
142 | { |
142 | for (pl = first_player; pl; pl = pl->next) |
143 | for (pl = first_player; pl; pl = pl->next) |
143 | if (pl->ob->container == op->env) |
144 | if (pl->ob->container == op->env) |
144 | break; |
145 | break; |
|
|
146 | |
145 | if (pl) |
147 | if (pl) |
146 | tmp = pl->ob; |
148 | tmp = pl->ob; |
147 | else |
149 | else |
148 | tmp = NULL; |
150 | tmp = NULL; |
149 | } |
151 | } |
|
|
152 | |
150 | if (tmp) |
153 | if (tmp) |
151 | esrv_send_item (tmp, op); |
154 | esrv_send_item (tmp, op); |
152 | } |
155 | } |
153 | else |
156 | else |
154 | { |
157 | { |
… | |
… | |
174 | { |
177 | { |
175 | /* no action necessary: remove_ob() notifies the client */ |
178 | /* no action necessary: remove_ob() notifies the client */ |
176 | return; |
179 | return; |
177 | } |
180 | } |
178 | |
181 | |
179 | tmp = is_player_inv (op->env); |
182 | tmp = op->in_player (); |
180 | if (!tmp) |
183 | if (!tmp) |
181 | { |
184 | { |
182 | for (pl = first_player; pl; pl = pl->next) |
185 | for (pl = first_player; pl; pl = pl->next) |
183 | if (pl->ob->container == op->env) |
186 | if (pl->ob->container == op->env) |
184 | break; |
187 | break; |
… | |
… | |
1090 | x = va_arg (args, int); |
1093 | x = va_arg (args, int); |
1091 | y = va_arg (args, int); |
1094 | y = va_arg (args, int); |
1092 | |
1095 | |
1093 | va_end (args); |
1096 | va_end (args); |
1094 | |
1097 | |
1095 | rv = get_map_ob (map, x, y); |
1098 | rv = GET_MAP_OB (map, x, y); |
1096 | *type = CFAPI_POBJECT; |
1099 | *type = CFAPI_POBJECT; |
1097 | return rv; |
1100 | return rv; |
1098 | } |
1101 | } |
1099 | |
1102 | |
1100 | void * |
1103 | void * |
… | |
… | |
1971 | player *pl; |
1974 | player *pl; |
1972 | |
1975 | |
1973 | op->nrof = iarg; |
1976 | op->nrof = iarg; |
1974 | if (op->env != NULL) |
1977 | if (op->env != NULL) |
1975 | { |
1978 | { |
1976 | tmp = is_player_inv (op->env); |
1979 | tmp = op->in_player (); |
1977 | if (!tmp) |
1980 | if (!tmp) |
1978 | { |
1981 | { |
1979 | for (pl = first_player; pl; pl = pl->next) |
1982 | for (pl = first_player; pl; pl = pl->next) |
1980 | if (pl->ob->container == op->env) |
1983 | if (pl->ob->container == op->env) |
1981 | break; |
1984 | break; |
… | |
… | |
2132 | player *pl; |
2135 | player *pl; |
2133 | |
2136 | |
2134 | op->weight = iarg; |
2137 | op->weight = iarg; |
2135 | if (op->env != NULL) |
2138 | if (op->env != NULL) |
2136 | { |
2139 | { |
2137 | tmp = is_player_inv (op->env); |
2140 | tmp = op->in_player (); |
2138 | if (!tmp) |
2141 | if (!tmp) |
2139 | { |
2142 | { |
2140 | for (pl = first_player; pl; pl = pl->next) |
2143 | for (pl = first_player; pl; pl = pl->next) |
2141 | if (pl->ob->container == op->env) |
2144 | if (pl->ob->container == op->env) |
2142 | break; |
2145 | break; |
… | |
… | |
2694 | break; |
2697 | break; |
2695 | |
2698 | |
2696 | case 3: |
2699 | case 3: |
2697 | op = va_arg (args, object *); |
2700 | op = va_arg (args, object *); |
2698 | |
2701 | |
2699 | rv = is_player_inv (op); |
2702 | rv = op->in_player (); |
2700 | break; |
2703 | break; |
2701 | |
2704 | |
2702 | default: |
2705 | default: |
2703 | rv = NULL; |
2706 | rv = NULL; |
2704 | *type = CFAPI_NONE; |
2707 | *type = CFAPI_NONE; |
… | |
… | |
3310 | drop (author, op); |
3313 | drop (author, op); |
3311 | |
3314 | |
3312 | if (author->type == PLAYER) |
3315 | if (author->type == PLAYER) |
3313 | { |
3316 | { |
3314 | author->contr->count = 0; |
3317 | author->contr->count = 0; |
3315 | author->contr->socket->update_look = 1; |
3318 | author->contr->socket->floorbox_update (); |
3316 | } |
3319 | } |
3317 | |
3320 | |
3318 | *type = CFAPI_NONE; |
3321 | *type = CFAPI_NONE; |
3319 | return NULL; |
3322 | return NULL; |
3320 | } |
3323 | } |