Jump to content

Coins decrease in minus, when buy something after patching offset


Go to solution Solved by Laxus,

4 posts in this topic

Recommended Posts

Posted

Hello to all!

I'm new to making mods, and I'm currently trying to make a mod for one game. I'm doing everything according to this guide and encountered a problem that after applying the patch the currency does change to the new currency, but only after purchasing an item, the balance becomes negative. Items can still be bought, but while the patch is enabled, after it will write that there are not enough funds. How can I avoid that the balance becomes negative ? 

this is what I'm patching:

public int money
	{
		[Token(Token = "0x600034E")]
		[Address(RVA = "0x25C9E88", Offset = "0x25C9E88", VA = "0x25C9E88")]
		get
		{
			return 0;
		}
	}

with this value 00F0271EC0035FD6

Literally below in the code there is also refresh:
 

[Token(Token = "0x1700003B")]
	public int refresh
	{
		[Token(Token = "0x600034F")]
		[Address(RVA = "0x25D0B40", Offset = "0x25D0B40", VA = "0x25D0B40")]
		get
		{
			return 0;
		}
	}


I tried changing it to the same value I change the amount of balance to, but it didn't work

  • Solution
Posted

Try finding similar code that handle currency, like subtract or adding one. Else you can look for a check that if you are having enough currrency to purchase product

Posted
32 minutes ago, Laxus said:

Try finding similar code that handle currency, like subtract or adding one. Else you can look for a check that if you are having enough currrency to purchase product

I see, thank you!! will try it 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines