|
596 | 596 |
|
597 | 597 | //If the item is in a storage item, take it out |
598 | 598 | var/outside_storage = !loc.atom_storage |
599 | | - var/turf/storage_turf |
600 | | - if(loc.atom_storage) |
601 | | - //We want the pickup animation to play even if we're moving the item between movables. Unless the mob is not located on a turf. |
602 | | - if(isturf(user.loc)) |
603 | | - storage_turf = get_turf(loc) |
604 | | - if(!loc.atom_storage.remove_single(user, src, user, silent = TRUE)) |
605 | | - return |
| 599 | + var/atom/anim_loc = loc |
| 600 | + if(loc.atom_storage && !loc.atom_storage?.remove_single(user, src, user, silent = TRUE)) |
| 601 | + return |
606 | 602 | if(QDELETED(src)) //moving it out of the storage destroyed it. |
607 | 603 | return |
608 | 604 |
|
609 | | - if(storage_turf) |
610 | | - do_pickup_animation(user, storage_turf) |
| 605 | + if(isturf(user.loc)) |
| 606 | + // Animation only plays if the user is on a turf |
| 607 | + // However if the anim_loc is not on a turf (ie held by a mob) we need to use user loc |
| 608 | + do_pickup_animation(user, (isturf(anim_loc) || isturf(anim_loc.loc)) ? anim_loc : user.loc) |
611 | 609 |
|
612 | 610 | if(throwing) |
613 | 611 | throwing.finalize(FALSE) |
|
618 | 616 | . = FALSE |
619 | 617 | pickup(user) |
620 | 618 | add_fingerprint(user) |
621 | | - if(!user.put_in_active_hand(src, ignore_animation = !outside_storage)) |
| 619 | + if(!user.put_in_active_hand(src, ignore_animation = TRUE)) |
622 | 620 | user.dropItemToGround(src) |
623 | 621 | return TRUE |
624 | 622 |
|
|
1272 | 1270 |
|
1273 | 1271 | ///Called by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else. |
1274 | 1272 | /obj/item/proc/on_thrown(mob/living/carbon/user, atom/target) |
1275 | | - if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP)) |
| 1273 | + if(item_flags & ABSTRACT) |
| 1274 | + return |
| 1275 | + // Skip animation is important here because it interferes with the throwing animation. |
| 1276 | + if(!user.transferItemToLoc(src, drop_location(), silent = TRUE, animated = FALSE)) |
1276 | 1277 | return |
1277 | | - user.dropItemToGround(src, silent = TRUE) |
1278 | 1278 | if(throwforce && HAS_TRAIT(user, TRAIT_PACIFISM)) |
1279 | 1279 | to_chat(user, span_notice("You set [src] down gently on the ground.")) |
1280 | 1280 | return |
|
1463 | 1463 | pickup_animation.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA |
1464 | 1464 |
|
1465 | 1465 | var/direction = get_dir(source, target) |
1466 | | - var/to_x = target.base_pixel_x |
1467 | | - var/to_y = target.base_pixel_y |
| 1466 | + var/to_x = (target.pixel_x + target.pixel_w) - (source.pixel_x + source.pixel_w) |
| 1467 | + var/to_y = (target.pixel_y + target.pixel_z) - (source.pixel_y + source.pixel_z) |
1468 | 1468 |
|
1469 | 1469 | if(direction & NORTH) |
1470 | 1470 | to_y += 32 |
|
1495 | 1495 |
|
1496 | 1496 | var/turf/current_turf = get_turf(src) |
1497 | 1497 | var/direction = get_dir(moving_from, current_turf) |
1498 | | - var/from_x = moving_from.base_pixel_x |
1499 | | - var/from_y = moving_from.base_pixel_y |
| 1498 | + var/from_x = moving_from.pixel_x + moving_from.pixel_w |
| 1499 | + var/from_y = moving_from.pixel_y + moving_from.pixel_z |
1500 | 1500 |
|
1501 | 1501 | if(direction & NORTH) |
1502 | 1502 | from_y -= 32 |
|
0 commit comments