raise location/player changed events on load

This commit is contained in:
Jesse Plamondon-Willard 2017-05-17 14:30:57 -04:00
parent 0b853ca18d
commit 228f84eea6
1 changed files with 13 additions and 13 deletions

View File

@ -438,13 +438,6 @@ namespace StardewModdingAPI.Framework
*********/ *********/
if (Context.IsWorldReady) if (Context.IsWorldReady)
{ {
// raise events (only when something changes, not on the initial load)
if (Game1.uniqueIDForThisGame == this.PreviousSaveID)
{
// raise location list changed
if (this.GetHash(Game1.locations) != this.PreviousGameLocations)
LocationEvents.InvokeLocationsChanged(this.Monitor, Game1.locations);
// raise current location changed // raise current location changed
if (Game1.currentLocation != this.PreviousGameLocation) if (Game1.currentLocation != this.PreviousGameLocation)
{ {
@ -457,6 +450,13 @@ namespace StardewModdingAPI.Framework
if (Game1.player != this.PreviousFarmer) if (Game1.player != this.PreviousFarmer)
PlayerEvents.InvokeFarmerChanged(this.Monitor, this.PreviousFarmer, Game1.player); PlayerEvents.InvokeFarmerChanged(this.Monitor, this.PreviousFarmer, Game1.player);
// raise events that shouldn't be triggered on initial load
if (Game1.uniqueIDForThisGame == this.PreviousSaveID)
{
// raise location list changed
if (this.GetHash(Game1.locations) != this.PreviousGameLocations)
LocationEvents.InvokeLocationsChanged(this.Monitor, Game1.locations);
// raise player leveled up a skill // raise player leveled up a skill
if (Game1.player.combatLevel != this.PreviousCombatLevel) if (Game1.player.combatLevel != this.PreviousCombatLevel)
PlayerEvents.InvokeLeveledUp(this.Monitor, EventArgsLevelUp.LevelType.Combat, Game1.player.combatLevel); PlayerEvents.InvokeLeveledUp(this.Monitor, EventArgsLevelUp.LevelType.Combat, Game1.player.combatLevel);