-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows trays to drop their items, adds color to material items on trays #739
Conversation
for(var/obj/item/I in carrying) | ||
I.loc = loc | ||
carrying.Remove(I) | ||
if(!foundtable && isturf(loc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire foundtable thing could be replaced with
if(isturf(src.loc) && !(locate(/obj/structure/table) in src.loc))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was focusing on having the code function as opposed to optimization. As it stood, it would call all of the locs prior to moving the item, and would always appear to be in someone's hands to this call in natural conditions.
All I did was make it wait until the tray was moved to run all of the checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, fair enough.
👍 |
I would like to add that this is really a hackfix and adding spawn() to fix timing issues should be avoided, but trays are overall really horrible code, so, whatever. |
I will admit this is a hackfix, but I have a feeling I would have to rewrite how dropped is called if I wanted to do it the way I wanted to. |
sleep(rand(2,4)) | ||
overlays.Cut() | ||
for(var/obj/item/I in carrying) | ||
I.loc = loc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend using I.forceMove(loc)
instead to ensure light sources update properly among other things.
I'll do a proper rewrite when I'm not working (see: Monday afternoon, Tuesday.) |
So, trying to avoid spawn() was not working out for me, so I set it to spawn() instead of spawn(1) and made some optimizations. I also added colors to material based items that trays pick up. |
Allows trays to drop their items, adds color to material items on trays
Trays once again drop their items properly.
Fixes #557