Skip to content
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

Merged
merged 3 commits into from
Jan 16, 2016
Merged

Conversation

Datraen
Copy link
Contributor

@Datraen Datraen commented Jan 8, 2016

Trays once again drop their items properly.

Fixes #557

for(var/obj/item/I in carrying)
I.loc = loc
carrying.Remove(I)
if(!foundtable && isturf(loc))
Copy link
Contributor

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))

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, fair enough.

@MistakeNot4892
Copy link
Contributor

👍

@MistakeNot4892
Copy link
Contributor

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.

@Datraen
Copy link
Contributor Author

Datraen commented Jan 8, 2016

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
Copy link
Contributor

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.

@Datraen
Copy link
Contributor Author

Datraen commented Jan 11, 2016

I'll do a proper rewrite when I'm not working (see: Monday afternoon, Tuesday.)

@Datraen
Copy link
Contributor Author

Datraen commented Jan 14, 2016

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.

@Datraen Datraen changed the title Fixes trays! Allows trays to drop their items, adds color to material items on trays Jan 14, 2016
Neerti added a commit that referenced this pull request Jan 16, 2016
Allows trays to drop their items, adds color to material items on trays
@Neerti Neerti merged commit 02b8599 into PolarisSS13:master Jan 16, 2016
@Datraen Datraen deleted the Trayfix branch February 24, 2016 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants