Adjust fossil creation

Fixes #1801 (closed)

There was a slight ordering issue with fossil pokemon being created:

  • Pokemon was created
  • Pokemon was added to player party, causing a S2C packet to be queued (SetPartyPokemonPacket or SetPcPokemonPacket)
  • FOSSIL_REVIVED event triggered, which causes modification to the Pokemon
  • Occasionally, the above steps cause a concurrent modification issue, where the S2C encoding was reading data out of a container that was being modified to a different size

Now:

  • Pokemon is created
  • FOSSIL_REVIVED event triggered
  • Pokemon is added to player party

This also appears to have a side benefit of one less packet being generated (MarksPotentialUpdatePacket); see https://mclo.gs/9drb308 (main) vs https://mclo.gs/Q4rGND2 (this branch)

Merge request reports

Loading