ModernUO/Projects/UOContent/Engines
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
..
Advanced Search fix: Fixes Advanced Search crash (#1946) 2024-09-08 20:37:51 -07:00
BuffIcons feat: Standardizes South/East selection gumps (#1839) 2025-02-14 00:15:14 -08:00
Bulk Orders fix: Updates BOB/BOD gumps to the new API (#2250) 2025-09-07 12:50:20 -07:00
CannedEvil fix: Eliminates allocations in canned evil timer (#2209) 2025-06-02 22:48:14 -10:00
Character Creation fix: Fixes and optimizes NameVerification and ProfanityProtection (#2153) 2025-04-12 02:26:10 -07:00
Chat fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
ConPVP feat: Converts OnLogin to a coded generated event (#2070) 2025-01-17 15:21:45 -08:00
Craft fix: Adds colored logs to fletching (#2223) 2025-06-28 17:32:13 -07:00
Doom chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Ethics fix: Fixes ethics causing crashes when not used (#1972) 2024-10-15 17:02:11 -07:00
Events fix: Streamlines event scheduler API. Adds months to weekly recurrence (#2178) 2025-05-07 22:42:44 -07:00
Factions fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
Harvest fix: Fixes mining/lumberjacking multi-harvest (#2249) 2025-08-20 15:30:04 -07:00
Help fix: Fixes AddLabelPlaceholder on StaticGump (#2121) 2025-02-13 18:53:24 -08:00
Khaldun fix: Adds missing string interpolation handler for SetStringSlot (#2123) 2025-02-13 19:30:47 -08:00
ML Quests chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Party feat: Converts OnLogin to a coded generated event (#2070) 2025-01-17 15:21:45 -08:00
Pathing feat: Refactors A* Movement to use PriorityQueue (#2244) 2025-07-26 15:53:06 -07:00
Plants fix: Fix PlantSystem serialization of LeftSeeds and LeftResources at zero (#2255) 2025-10-31 00:53:47 -07:00
Player Murder System fix: Fixes decaying kill on disconnect (#2199) 2025-05-25 22:06:26 -07:00
Quests fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
Spawners feat: Replaces params array with params ReadOnlySpan (#2125) 2025-02-13 21:19:02 -08:00
Stealables fix: Consolidates Color/Center html (#1762) 2024-05-07 23:56:32 -07:00
Treasures of Tokuno fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
UltimaStore fix: Fixes thread guard and cleans up incoming packet reader (#1641) 2023-12-19 17:04:09 -08:00
Veteran Rewards fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
Virtues fix: Fixes removing virtue when player is deleted (#2135) 2025-03-02 17:50:18 -08:00