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

[FIX] Better slices #27807

Merged
merged 9 commits into from
Jan 25, 2025
Merged

[FIX] Better slices #27807

merged 9 commits into from
Jan 25, 2025

Conversation

Drsmail
Copy link
Contributor

@Drsmail Drsmail commented Jan 2, 2025

What Does This PR Do

  • Adds a new subtype /obj/item/food/slice to ensure similar slice behavior
  • Refactor a bunch of food subtypes form food/margaritapizzaslice to food/slice/margarita_pizza

Why It's Good For The Game

There will not be a slices with 0 reagents on maps

Testing

Built and runed.


Declaration

  • I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.

Changelog

🆑
Fix: All food slices on maps have nutritional values.
Tweak: Some sliceable food nutritional values have been increased, so the slices contain a whole amount of reagents.
/:cl:

@Drsmail
Copy link
Contributor Author

Drsmail commented Jan 2, 2025

This line pizza = new pizza_type(src) in code\modules\food_and_drinks\food\foods\pizza.dm cause CRACH to trigger, i have no idea how to handle this.

/obj/item/food/sliceable/Initialize(mapload)
	if(!istype(slice_path, /obj/item/food/slice))
		CRASH("Invalid type assigned to slice_path: [slice_path]")
	return ..()

Also there is steal some slices that are used by maps, but don't have a reagent list. For example:

/obj/item/food/slice/bread
	name = "bread slice"
	desc = "A slice of home."
	list_reagents = list("nutriment" = 2, "bread" = 5) // has it!
	tastes = list("bread" = 1)
/obj/item/food/slice/pumpkinpie
	name = "pumpkin pie slice"
	desc = "A slice of pumpkin pie, with whipped cream on top. Perfection."
	icon = 'icons/obj/food/bakedgoods.dmi'
	// does not have it!
	tastes = list("pie" = 1, "pumpkin" = 1)

How this should be handled?
@DGamerL

@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally Map Edit This PR will modify a map labels Jan 2, 2025
@Drsmail Drsmail marked this pull request as ready for review January 3, 2025 02:49
@Drsmail Drsmail changed the title [???] Better slices [FIX] Better slices Jan 3, 2025
@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting review This PR is awaiting review from the review team and removed -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally labels Jan 3, 2025
@Burzah Burzah added the Fix This PR will fix an issue in the game label Jan 3, 2025
@github-actions github-actions bot added the Merge Conflict This PR is merge conflicted label Jan 6, 2025
Copy link
Contributor

@FunnyMan3595 FunnyMan3595 left a comment

Choose a reason for hiding this comment

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

Needs those two files reverted, otherwise seems fine.

@Drsmail
Copy link
Contributor Author

Drsmail commented Jan 9, 2025

Needs those two files reverted, otherwise seems fine.

Done

@Drsmail Drsmail requested a review from FunnyMan3595 January 9, 2025 00:32
@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting merge This PR is ready for merge and removed -Status: Awaiting review This PR is awaiting review from the review team labels Jan 9, 2025
@github-actions github-actions bot removed the Merge Conflict This PR is merge conflicted label Jan 12, 2025
@Burzah Burzah requested a review from DGamerL January 17, 2025 18:44
@Burzah Burzah added this pull request to the merge queue Jan 25, 2025
Merged via the queue into ParadiseSS13:master with commit 754a868 Jan 25, 2025
17 checks passed
@Drsmail Drsmail deleted the Better-slices branch January 25, 2025 20:02
Comment on lines +295 to +299
/obj/item/food/sliceable/Initialize(mapload)
if(!ispath(slice_path, /obj/item/food/sliced))
CRASH("Invalid type assigned to slice_path: [slice_path]")
return ..()

Copy link
Member

Choose a reason for hiding this comment

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

Please remove this, in case someone wants to add a non-sliced food as a result

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 will remove this

Comment on lines +281 to +282
if(made_by_sliceable)
return ..()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(made_by_sliceable)
return ..()
if(made_by_sliceable)
list_reagents = list()
return ..()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be called from here -> var/obj/slice = new slice_path (loc, TRUE)
That means we are sliced normally and we have a 'parent', all reagents calculations were handled.
This is why we return.

if(made_by_sliceable)
		return ..()

Anyway, we have var/list/list_reagents = list() from /obj/item/food.
So what was the reason for changes? What do you want to change?

@Drsmail
Copy link
Contributor Author

Drsmail commented Jan 26, 2025

@DGamerL How do i handle changes after PR got merged? Do i create a new one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Status: Awaiting merge This PR is ready for merge Fix This PR will fix an issue in the game Map Edit This PR will modify a map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants