diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-10 02:22:06 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-10-10 02:22:06 -0400 |
commit | 5dfb12c2781c73854dc9aff2ae12b0a8de83c408 (patch) | |
tree | 3a36cc956e657fe0e3126d0377938b010cfb8685 | |
parent | c74b21141cfad4d02f899462e02e36818154e152 (diff) | |
download | SMAPI-5dfb12c2781c73854dc9aff2ae12b0a8de83c408.tar.gz SMAPI-5dfb12c2781c73854dc9aff2ae12b0a8de83c408.tar.bz2 SMAPI-5dfb12c2781c73854dc9aff2ae12b0a8de83c408.zip |
fix input events having decimal tile coordinates (#367)
-rw-r--r-- | src/SMAPI/Framework/SGame.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 7287cab7..6f8f7cef 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -378,7 +378,7 @@ namespace StardewModdingAPI.Framework { // cursor position Vector2 screenPixels = new Vector2(Game1.getMouseX(), Game1.getMouseY()); - Vector2 tile = new Vector2((Game1.viewport.X + screenPixels.X) / Game1.tileSize, (Game1.viewport.Y + screenPixels.Y) / Game1.tileSize); + Vector2 tile = new Vector2((int)((Game1.viewport.X + screenPixels.X) / Game1.tileSize), (int)((Game1.viewport.Y + screenPixels.Y) / Game1.tileSize)); Vector2 grabTile = (Game1.mouseCursorTransparency > 0 && Utility.tileWithinRadiusOfPlayer((int)tile.X, (int)tile.Y, 1, Game1.player)) // derived from Game1.pressActionButton ? tile : Game1.player.GetGrabTile(); |