Skip to content

Commit

Permalink
can no longer /pay users a negative value
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderBr committed Nov 29, 2022
1 parent c63d602 commit 63e4af7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 2 deletions.
Binary file modified .vs/ProjectEvaluation/simpleecon.metadata.v5.2
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/simpleecon.projects.v5.2
Binary file not shown.
Binary file modified .vs/SimpleEcon/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/SimpleEcon/v17/.futdcache.v2
Binary file not shown.
9 changes: 7 additions & 2 deletions SimpleEcon/SimpleEcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,13 @@ private void PayUser(CommandArgs args)
return;
}
float amount = float.Parse(args.Parameters[1]);

if(amount <= PlayerManager.GetPlayer(args.Player.Name).balance)
if(amount < 1)
{
args.Player.SendErrorMessage("Please send a valid amount!");
return;
}

if (amount <= PlayerManager.GetPlayer(args.Player.Name).balance)
{
PlayerManager.GetPlayer(args.Player.Name).balance -= amount;
PlayerManager.GetPlayer(player.Name).balance += amount;
Expand Down

5 comments on commit 63e4af7

@GlitchismQ
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is yes

@RenderBr
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is yes

uh yes

@NyanPidgeon4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn I really liked the useful negative values trick

@RenderBr
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn I really liked the useful negative values trick

wdym?

@Evauation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably means they liked the free money or draining other people's balances lol.

Please sign in to comment.