ModernUO/Projects/UOContent
Copilot fbf8497c59
fix: Fix PlantSystem serialization of LeftSeeds and LeftResources at zero (#2255)
* Initial plan

* Add SerializableFieldDefault attributes for LeftSeeds and LeftResources

This fixes the serialization bug where _leftSeeds and _leftResources were initialized to 8 in the constructor but didn't serialize when their value was 0. Upon deserialization, the constructor would run again and reset these values back to 8.

The SerializableFieldDefault attributes tell the serialization system that the default value is 8, so it will properly serialize 0 values and maintain the correct state across server restarts.

Co-authored-by: kamronbatman <3953314+kamronbatman@users.noreply.github.com>

* Update ShouldSerialize methods to check against default value

Changed ShouldSerializeLeftSeeds() and ShouldSerializeLeftResources() to check if the value is != 8 (the default) instead of != 0. This ensures that only non-default values are serialized, following the same pattern used in BaseWeapon.cs and other classes with SerializableFieldDefault attributes.

Co-authored-by: kamronbatman <3953314+kamronbatman@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kamronbatman <3953314+kamronbatman@users.noreply.github.com>
2025-10-31 00:53:47 -07:00
..
Accounting fix: Fixes props for interfaces and adds account manipulation (#2179) 2025-05-09 15:39:47 -07:00
Assistants feat: Converts OnLogin to a coded generated event (#2070) 2025-01-17 15:21:45 -08:00
Commands feat: Adds ClearXY command (#2229) 2025-07-06 20:15:50 -07:00
Compression fix: Fixes directory copying (#1668) 2024-02-09 23:25:20 -08:00
Configuration chore: Updates copyright (#1448) 2023-08-09 09:09:26 -07:00
Console feat: Adds console commands (#1714) 2024-03-30 09:40:43 -07:00
Context Menus fix: Moves ContextMenu out of core, streamlines code, fixes bugs (#1873) 2024-07-20 21:33:23 -07:00
Engines fix: Fix PlantSystem serialization of LeftSeeds and LeftResources at zero (#2255) 2025-10-31 00:53:47 -07:00
Gumps feat: New Jail System (#2215) 2025-07-16 20:41:21 -07:00
Holiday Stuff fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
Items fix: Fixes dropping a stack of scrolls on a spellbook (#2248) 2025-08-09 20:55:36 -07:00
Migrations fix: Fixes tentacles not getting removed from harrower's list (#2239) 2025-07-24 14:18:16 -07:00
Misc fix: Fixes detecting consecutive exceptions in name validation (#2192) 2025-05-18 21:02:05 -07:00
Mobiles fix: fixes movement jitter for non-AOS (#2245) 2025-07-26 10:21:36 -07:00
Multis fix: Optimizes items to use default weights. (Part 4) (#2243) 2025-07-24 23:29:29 -07:00
Network fix: Fixes gold trade exploit (clearing checks properly) (#2207) 2025-06-01 10:38:28 -10:00
Regions feat: New Jail System (#2215) 2025-07-16 20:41:21 -07:00
Skills fix: Fixes skill cooldown for some target skills (#2231) 2025-07-06 22:50:40 -07:00
Special Systems feat: Converts OnLogin to a coded generated event (#2070) 2025-01-17 15:21:45 -08:00
Spells fix: Standardizes the variables for AI (#2234) 2025-07-18 17:50:32 -07:00
Systems/JailSystem feat: New Jail System (#2215) 2025-07-16 20:41:21 -07:00
Targets chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Text feat: Moves gumps out of the core (#1916) 2024-08-09 19:07:32 -07:00
Utilities fix: Fixes various mobile packets and setting serials (#1618) 2023-11-26 00:42:15 -08:00
World Saves chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Module.cs fix: Fixes sending packets and sidesteps a major issue with stackalloc and PGO in .NET 8 (#1607) 2023-11-21 12:18:20 -08:00
UOContent.csproj chore: Bumps various dependencies (#2237) 2025-07-22 16:04:04 -07:00