|
458 | 458 |
|
459 | 459 | /// Tries to equip an item, store it in open storage, or in next best storage |
460 | 460 | /obj/item/proc/equip_to_best_slot(mob/user) |
| 461 | +// NON-MODULE CHANGE START : prioritize active storage over suit storage and pockets |
| 462 | + var/slot_priority = src.slot_equipment_priority |
| 463 | + |
| 464 | + if(!slot_priority) |
| 465 | + slot_priority = list( \ |
| 466 | + ITEM_SLOT_BACK, ITEM_SLOT_ID,\ |
| 467 | + ITEM_SLOT_ICLOTHING, ITEM_SLOT_OCLOTHING,\ |
| 468 | + ITEM_SLOT_MASK, ITEM_SLOT_HEAD, ITEM_SLOT_NECK,\ |
| 469 | + ITEM_SLOT_FEET, ITEM_SLOT_GLOVES,\ |
| 470 | + ITEM_SLOT_EARS, ITEM_SLOT_EYES,\ |
| 471 | + ITEM_SLOT_BELT\ |
| 472 | + ) |
| 473 | + |
| 474 | + var/can_equip = FALSE |
| 475 | + |
| 476 | + for(var/slot in slot_priority) |
| 477 | + if(src.mob_can_equip(user, slot, TRUE, TRUE)) |
| 478 | + can_equip = TRUE |
| 479 | + break |
| 480 | + |
| 481 | + if(!can_equip && user.active_storage?.attempt_insert(src, user, messages = FALSE)) |
| 482 | + return TRUE |
| 483 | + |
461 | 484 | if(user.equip_to_appropriate_slot(src)) |
462 | 485 | user.update_held_items() |
463 | 486 | return TRUE |
464 | 487 | else |
465 | 488 | if(equip_delay_self) |
466 | 489 | return |
467 | | - |
| 490 | +/* |
468 | 491 | if(user.active_storage?.attempt_insert(src, user, messages = FALSE)) |
469 | 492 | return TRUE |
470 | | - |
| 493 | +*/ |
| 494 | +// NON-MODULE CHANGE END |
471 | 495 | var/list/obj/item/possible = list( |
472 | 496 | user.get_inactive_held_item(), |
| 497 | + user.get_item_by_slot(ITEM_SLOT_SUITSTORE), // NON-MODULE CHANGE : holsters, *maybe* some other things? |
473 | 498 | user.get_item_by_slot(ITEM_SLOT_BELT), |
474 | 499 | user.get_item_by_slot(ITEM_SLOT_DEX_STORAGE), |
475 | 500 | user.get_item_by_slot(ITEM_SLOT_BACK), |
|
502 | 527 | . += item |
503 | 528 |
|
504 | 529 | ///proc extender of [/mob/verb/quick_equip] used to make the verb queuable if the server is overloaded |
| 530 | + |
| 531 | +// NON-MODULE CHANGE START : quick equip to active storage if available |
505 | 532 | /mob/proc/execute_quick_equip() |
506 | 533 | var/obj/item/I = get_active_held_item() |
507 | 534 | if(!I) |
508 | | - to_chat(src, span_warning("You are not holding anything to equip!")) |
509 | | - return |
510 | | - if (temporarilyRemoveItemFromInventory(I) && !QDELETED(I)) |
511 | | - if(I.equip_to_best_slot(src)) |
512 | | - return |
513 | | - if(put_in_active_hand(I)) |
514 | | - return |
515 | | - I.forceMove(drop_location()) |
| 535 | + var/datum/storage/storage = src.active_storage |
| 536 | + if(storage?.real_location.contents.len) |
| 537 | + var/obj/item/stored = storage.real_location.contents[storage.real_location.contents.len] |
| 538 | + if(!stored || stored.on_found(src)) |
| 539 | + to_chat(src, span_warning("You are not holding anything to equip!")) |
| 540 | + return |
| 541 | + stored.attack_hand(src) // take out thing from item in storage slot |
| 542 | + if(!QDELETED(I)) |
| 543 | + I.equip_to_best_slot(src) |
| 544 | +// NON-MODULE CHANGE END |
516 | 545 |
|
517 | 546 | //used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...) |
518 | 547 | /mob/proc/getBackSlot() |
|
0 commit comments