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

[MIRROR] Fix table top deconstruction #2815

Merged
merged 2 commits into from
Apr 11, 2024
Merged

[MIRROR] Fix table top deconstruction #2815

merged 2 commits into from
Apr 11, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Nova: NovaSector/NovaSector#1880
Original PR: tgstation/tgstation#82508

About The Pull Request

Edited: updated changelog, read comments for changes in implementation details

So previously, tables would let you use a wrench to fully deconstruct them, or a screwdriver to take off only their top.
This, however, broke in two different ways in #82280, when their deconstruction logic got changed.

First off, deconstructed tables would only drop the materials for their top and not their frame.
For this, the primary culprit seems to be on line 307:
https://github.com/tgstation/tgstation/blob/c34d56a45b0461f5e0fad3cc75e81580c3357119/code/game/objects/structures/tables_racks.dm#L300-L307
Where new framestack(target_turf, framestackamount) accidentally got an extra indent, and ended up in the less common half of the if-else chain.
Just moving this outside of the if-else chain again fixes it.

Secondly, tables had their own special deconstruction logic, which got 'standardized'.
Issue. This was special to accommodate for having two different deconstruction logics: full or top only.
With deconstruct(...) no longer being overridable, I feel it's awkward to attempt to proxy that information to the new atom_deconstruct(...)
So we introduce a new method, deconstruct_top, for the screwdriver to use, which handles deconstructing only the top.

/obj/structure/table/proc/deconstruct_top()
	var/obj/table_frame = new frame(loc)
	if(obj_flags & NO_DECONSTRUCTION)
		table_frame.obj_flags |= NO_DECONSTRUCTION
	else // Mimic deconstruction logic, only drop our materials without NO_DECONSTRUCTION
		var/turf/target_turf = get_turf(src)
		drop_top_mats(target_turf)
	qdel(src)

Mimicking the NO_DECONSTRUCTION logic of normal deconstruction, and copying over the flag onto its frames if need be.
This fixes screwdriver deconstruction.

Why It's Good For The Game

Fixes #82503.
We can now deconstruct the table top separately again, AND get the right materials back too.

Changelog

🆑 00-Steven, SyncIt21
fix: Wrench table deconstruction gives the right materials again.
fix: Screwdriver table deconstruction only deconstructs the top again.
/:cl:

* Fix table top deconstruction

* Update tables_racks.dm

* Update tables_racks.dm

---------

Co-authored-by: _0Steven <[email protected]>
Co-authored-by: Bloop <[email protected]>
@Steals-The-PRs Steals-The-PRs added Mirroring conflict git cherry-pick во что-то уткнулся. Не ставить вручную, только для бота TG Mirror labels Apr 10, 2024
@Iajret Iajret merged commit 619eee6 into master Apr 11, 2024
24 checks passed
@Iajret Iajret deleted the upstream-mirror-1880 branch April 11, 2024 08:02
AnywayFarus added a commit that referenced this pull request Apr 11, 2024
Iajret pushed a commit that referenced this pull request Jun 4, 2024
…#2815)

* Fixes crutches crippling you and giving infinite speedboosts (#83660)

Fixes #83646 

Fixes crutches setting your legs to null whenever you pick them up or
drop them
Fixes slowdown reduction on crutches being permanent (this was hard to
notice because they instantly cripple you)

:cl:
fix: fixes touching a crutch permanently crippling you
fix: fixes crutches giving permanent speedboosts even when dropped
/:cl:

* Fixes crutches crippling you and giving infinite speedboosts

---------

Co-authored-by: Time-Green <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
AnywayFarus pushed a commit that referenced this pull request Jun 4, 2024
…#2815) (#3622)

* Fixes crutches crippling you and giving infinite speedboosts (#83660)

Fixes #83646 

Fixes crutches setting your legs to null whenever you pick them up or
drop them
Fixes slowdown reduction on crutches being permanent (this was hard to
notice because they instantly cripple you)

:cl:
fix: fixes touching a crutch permanently crippling you
fix: fixes crutches giving permanent speedboosts even when dropped
/:cl:

* Fixes crutches crippling you and giving infinite speedboosts

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: Time-Green <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mirroring conflict git cherry-pick во что-то уткнулся. Не ставить вручную, только для бота TG Mirror
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants