SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Crop growth model not updating #4462

Closed ai-kana closed 1 week ago

ai-kana commented 1 month ago

When using BarricadeManager.updateFarm() to change when a planted was placed it does not updated the model in InteractableFarm.Update() if the plant is going from a fully grown state to non-fully grown state.

InteractableFarm.updateState() does update the state but doesn't replicate it to clients as BarricadeManager.updateFarm() does.

SDGNelson commented 1 month ago

This isn't something the game supports / expects to happen. Are you making a plugin which resets farms?

ai-kana commented 1 month ago

Yes, I am making a plugin that resets farms.

SDGNelson commented 1 month ago

Would it work to damage the existing farm and immediately spawn a new one replacing it? Or is there some state that would be lost?

ai-kana commented 1 month ago

That is possible. I'm trying to give the harvester one of the two items and revert the plants state. This is so that they don't have to craft seeds and replant.

While possible I don't see this as a very good fix.