… | |
… | |
228 | esrv_send_face (pl->contr->socket, empty_face->number, 0); |
228 | esrv_send_face (pl->contr->socket, empty_face->number, 0); |
229 | |
229 | |
230 | if (pl->contr->socket->look_position) |
230 | if (pl->contr->socket->look_position) |
231 | { |
231 | { |
232 | char buf[80]; |
232 | char buf[80]; |
233 | snprintf (buf, 80, "Apply this to see %d previous items", NUM_LOOK_OBJECTS); |
233 | snprintf (buf, 80, "Apply this to see %d previous items", FLOORBOX_PAGESIZE); |
234 | |
234 | |
235 | sl << uint32 (0x80000000 | (pl->contr->socket->look_position - NUM_LOOK_OBJECTS)) |
235 | sl << uint32 (0x80000000 | (pl->contr->socket->look_position - FLOORBOX_PAGESIZE)) |
236 | << uint32 (0) |
236 | << uint32 (0) |
237 | << sint32 (-1) |
237 | << sint32 (-1) |
238 | << uint32 (empty_face->number) |
238 | << uint32 (empty_face->number) |
239 | << data8 (buf) |
239 | << data8 (buf) |
240 | << uint16 (0) |
240 | << uint16 (0) |
… | |
… | |
261 | if (++start_look < pl->contr->socket->look_position) |
261 | if (++start_look < pl->contr->socket->look_position) |
262 | continue; |
262 | continue; |
263 | |
263 | |
264 | end_look++; |
264 | end_look++; |
265 | |
265 | |
266 | if (end_look > NUM_LOOK_OBJECTS) |
266 | if (end_look > FLOORBOX_PAGESIZE) |
267 | { |
267 | { |
268 | /* What we basically do is make a 'fake' object - when the user applies it, |
268 | /* What we basically do is make a 'fake' object - when the user applies it, |
269 | * we notice the special tag the object has, and act accordingly. |
269 | * we notice the special tag the object has, and act accordingly. |
270 | */ |
270 | */ |
271 | sl << uint32 (0x80000000 | (pl->contr->socket->look_position + NUM_LOOK_OBJECTS)) |
271 | sl << uint32 (0x80000000 | (pl->contr->socket->look_position + FLOORBOX_PAGESIZE)) |
272 | << uint32 (0) |
272 | << uint32 (0) |
273 | << uint32 ((uint32) - 1) |
273 | << uint32 ((uint32) - 1) |
274 | << uint32 (empty_face->number) |
274 | << uint32 (empty_face->number) |
275 | << data8 ("Apply this to see next group of items") |
275 | << data8 ("Apply this to see next group of items") |
276 | << uint16 (0) |
276 | << uint16 (0) |
… | |
… | |
634 | } |
634 | } |
635 | |
635 | |
636 | player_apply (pl->ob, op, 0, 0); |
636 | player_apply (pl->ob, op, 0, 0); |
637 | } |
637 | } |
638 | |
638 | |
639 | /** Client wants to apply some object. Lets do so. */ |
639 | /** Client wants to lock some object. Lets do so. */ |
640 | void |
640 | void |
641 | LockItem (char *data, int len, player *pl) |
641 | LockItem (char *data, int len, player *pl) |
642 | { |
642 | { |
643 | int flag = data[0]; |
643 | int flag = data[0]; |
644 | tag_t tag = net_uint32 ((uint8 *)data + 1); |
644 | tag_t tag = net_uint32 ((uint8 *)data + 1); |
… | |
… | |
656 | SET_FLAG (op, FLAG_INV_LOCKED); |
656 | SET_FLAG (op, FLAG_INV_LOCKED); |
657 | |
657 | |
658 | esrv_update_item (UPD_FLAGS, pl->ob, op); |
658 | esrv_update_item (UPD_FLAGS, pl->ob, op); |
659 | } |
659 | } |
660 | |
660 | |
661 | /** Client wants to apply some object. Lets do so. */ |
661 | /** Client wants to mark some object. Lets do so. */ |
662 | void |
662 | void |
663 | MarkItem (char *data, int len, player *pl) |
663 | MarkItem (char *data, int len, player *pl) |
664 | { |
664 | { |
665 | tag_t tag = net_uint32 ((uint8 *)data); |
665 | tag_t tag = net_uint32 ((uint8 *)data); |
666 | object *op = esrv_get_ob_from_count (pl->ob, tag); |
666 | object *op = esrv_get_ob_from_count (pl->ob, tag); |