TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Step_ForceCursorToAnyMinableThing()

static void Terraria.GameContent.SmartCursorHelper.Step_ForceCursorToAnyMinableThing ( SmartCursorUsageInfo providedInfo,
ref int fX,
ref int fY )
inlinestaticprivate

Definition at line 2318 of file SmartCursorHelper.cs.

2319 {
2320 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
2321 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
2322 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
2323 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
2324 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
2325 int reachableStartX = providedInfo.reachableStartX;
2326 int reachableStartY = providedInfo.reachableStartY;
2327 int reachableEndX = providedInfo.reachableEndX;
2328 int reachableEndY = providedInfo.reachableEndY;
2329 _ = providedInfo.screenTargetX;
2330 _ = providedInfo.screenTargetY;
2331 Vector2 mouse = providedInfo.mouse;
2332 Item item = providedInfo.item;
2333 if (fX != -1 || fY != -1 || PlayerInput.UsingGamepad)
2334 {
2335 return;
2336 }
2337 Point val = mouse.ToTileCoordinates();
2338 int x = val.X;
2339 int y = val.Y;
2340 if (Collision.InTileBounds(x, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY))
2341 {
2342 Tile tile = Main.tile[x, y];
2343 bool flag = tile.active() && WorldGen.CanKillTile(x, y) && (!Main.tileSolid[tile.type] || Main.tileSolidTop[tile.type]);
2344 if (flag && Main.tileAxe[tile.type] && item.axe < 1)
2345 {
2346 flag = false;
2347 }
2348 if (flag && Main.tileHammer[tile.type] && item.hammer < 1)
2349 {
2350 flag = false;
2351 }
2352 if (flag && !Main.tileHammer[tile.type] && !Main.tileAxe[tile.type] && item.pick < 1)
2353 {
2354 flag = false;
2355 }
2356 if (flag)
2357 {
2358 fX = x;
2359 fY = y;
2360 }
2361 }
2362 }

References Terraria.Tile.active(), Terraria.Item.axe, Terraria.WorldGen.CanKillTile(), Terraria.Item.hammer, Terraria.Collision.InTileBounds(), Terraria.Item.pick, Terraria.Main.tile, Terraria.Main.tileAxe, Terraria.Main.tileHammer, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, Terraria.Tile.type, and Terraria.GameInput.PlayerInput.UsingGamepad.

Referenced by Terraria.GameContent.SmartCursorHelper.SmartCursorLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: