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

Instant Teleporter Option & Performance to AutoFuel #752

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

IFoundTheLight
Copy link
Contributor

This should allow the users to enable instant teleporting for short range teleporters, otherwise it will take whatever time it takes to load into the area but it will remove the hardcoded 8 second minimum load time.

…ange teleporters, otherwise it will take whatever time it takes to load into the area but it will remove the hardcoded 8 second minimum load time.
@IFoundTheLight IFoundTheLight changed the title This should allow the users to enable instant teleporting for short r… Instant Teleporter Option Dec 29, 2022
@IFoundTheLight
Copy link
Contributor Author

@Xaekai @Zxurian @parasyte @exscape Any issues with adding this?

@Zxurian
Copy link
Contributor

Zxurian commented Jan 4, 2023

@IFoundTheLight I'm actually not using V+ anymore, sorry

@parasyte
Copy link
Contributor

parasyte commented Jan 4, 2023

IMHO, you should probably ping the maintainers. I'm just an observer.

Trying to apply a change for fixing lag and auto fuel.
@IFoundTheLight IFoundTheLight changed the title Instant Teleporter Option Instant Teleporter Option & Performance to AutoFuel Jan 5, 2023
Updated Image and Player teleport Disable 8 Second Timer
Copy link
Contributor

@healiha healiha left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this PR!

This looks pretty good, only a small thing to change.

Another important part, revert the change on the Valheim Plus logo, it shouldn't be altered in any way.

You can credit yourself by adding your name to the Credits in the README.md file.

if (threshold > 0 && InventoryAssistant.GetItemAmountInItemList(InventoryAssistant.GetNearbyChestItemsByContainerList(nearbyChests), itemConversion.m_to.m_itemData) >= threshold) return;
}
if (threshold > 0 && InventoryAssistant.GetItemAmountInItemList(
InventoryAssistant.GetNearbyChestItems(__instance.gameObject, autoFuelRange, !ignorePrivateAreaCheck), itemConversion.m_to.m_itemData) >= threshold
Copy link
Contributor

Choose a reason for hiding this comment

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

You should move the InventoryAssistant.GetNearbyChestItems call out of the foreach loop to avoid calling multiple time this function.

This function calls InventoryAssistant.GetNearbyChests which uses Physics.OverlapSphere. This is a function that has an heavy impact on performance and should only be run once for a given __instance.gameObject.

Grantapher added a commit to Grantapher/ValheimPlus that referenced this pull request May 28, 2023
@Grantapher
Copy link

Grantapher commented May 28, 2023

Added the teleporter shortener to https://github.com/Grantapher/ValheimPlus/releases/tag/0.9.9.15-alpha6

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.

5 participants