[dev] Merged Timeout.as & DecayUnused.as#2463
Open
mugg91 wants to merge 2 commits intotranshumandesign:masterfrom
Open
[dev] Merged Timeout.as & DecayUnused.as#2463mugg91 wants to merge 2 commits intotranshumandesign:masterfrom
mugg91 wants to merge 2 commits intotranshumandesign:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2447
This merges
TimeoutandDecayUnused.Now only the latter is used.
Grain and Steak now use the latter instead of the former.
They will decay after 60 seconds, unless they are moving, like before.
To check if blob is moving, a new Tag
"decay not moving"is used.Tested in offline and online, works as intended.
There are some changes to mention:
DecayUnusedwill check for movement every 60th tick. Used to be 30 inTimeout.DecayUnusedwill not check if the blob's inventory is empty like was done inTimeout. Implementing this would require some rewriting. For now, this is not of consequence since the corresponding blobs don't have an inventory.Grain.asnow usesthis.getCurrentScript().runFlags |= Script::remove_after_this;because after runningonInit()there is no reason to keep the script alive.Testing Steps
Place some trampolines on the ground.
Spawn bomb materials, grains and steaks.
Have a bomb material, grain and steak bounce on trampolines and have a bomb material, grain and steak lie on the ground.
After 60 seconds, grain and steak on the ground should disappear.
(If you picked it up and place it down again before disappearing, it will take another 60 seconds.)
After 5 minutes, bomb materials on the trampoline and on the ground should both disappear, same behavior as before this change.