Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearing Boats and duplicate horses #146

Open
plaidpants opened this issue Feb 28, 2024 · 0 comments
Open

Disappearing Boats and duplicate horses #146

plaidpants opened this issue Feb 28, 2024 · 0 comments

Comments

@plaidpants
Copy link

There appears to be an issue with the Save in Settlements feature. If you buy a horse and then leave it outside and then enter a settlement and then save inside the settlement and exit the game the horse will be duplicated when you relaunch the game and exit the settlement. This can also cause a loss of a ship if you happen to save inside a settlement after leaving your boat outside nearby without saving while outside. I fixed this issue in my code by updating this region of code that you modified for this feature. I copy the most recent outdoor npc information from the OUTMONST.SAV file that was last updated when you entered the settlement to the MONSTERS.SAV file which is loaded when you start the game. Not sure if there are additional cases that need attention.

file: U4_Q_N_V.C


struct tNPC temp;

/*C_6F29*/CMD_Quit()
{
...
/*ENABLE_TOWN_SAVE4*/
...
	if (Party._loc != 0 && Party._loc < 0x11)
	{
		/*Force doors to close before saving*/
		C_431D(); C_431D(); C_431D(); C_431D(); C_431D();
		if(Save("TOWNMAP.SAV", sizeof(struct t_500), &D_8742) == -1)
			exit(3);
		// Update the outdoor map save to the latest which was saved when we entered
		if(Load("OUTMONST.SAV", sizeof(struct tNPC), &temp) == -1)
			exit(3);
		if(Save("MONSTERS.SAV", sizeof(struct tNPC), &temp) == -1)
			exit(3);
		return 0;
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant