From 78a64485b2b38669f52cc9d125d5a5ff251e749e Mon Sep 17 00:00:00 2001 From: RSDuck Date: Sat, 31 Oct 2015 22:01:59 +0100 Subject: [PATCH] Stone can be placed back down --- Makefile | 2 +- source/Globals.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6503924..4f57573 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ include $(DEVKITARM)/3ds_rules #--------------------------------------------------------------------------------- TARGET := Minicraft3DS BUILD := build -SOURCES := source +SOURCES := source source/minizip DATA := data INCLUDES := include diff --git a/source/Globals.c b/source/Globals.c index ab79242..fcf7a68 100644 --- a/source/Globals.c +++ b/source/Globals.c @@ -473,7 +473,11 @@ s8 itemTileInteract(int tile, Item* item, int x, int y, int px, int py, int dir) if(rand()%5==0)addEntityToList(newItemEntity(newItem(ITEM_SEEDS,1),(x<<4)+8, (y<<4)+8,currentLevel),&eManager); setTile(TILE_DIRT,x,y); return 1; - } break; + } + else if(item->id == ITEM_STONE){ + setTile(TILE_ROCK,x,y); + --item->countLevel; + }break; case TILE_SAND: if(item->id == ITEM_CACTUS){ setTile(TILE_SAPLING_CACTUS,x,y); @@ -484,7 +488,12 @@ s8 itemTileInteract(int tile, Item* item, int x, int y, int px, int py, int dir) addEntityToList(newItemEntity(newItem(ITEM_SAND,1), (x<<4)+8, (y<<4)+8, currentLevel), &eManager); setTile(TILE_DIRT,x,y); return 1; - } break; + } + else if(item->id == ITEM_STONE){ + setTile(TILE_ROCK,x,y); + --item->countLevel; + } + break; case TILE_DIRT: if(item->id == TOOL_HOE && playerUseEnergy(4-item->countLevel)){ setTile(TILE_FARM,x,y); @@ -494,6 +503,9 @@ s8 itemTileInteract(int tile, Item* item, int x, int y, int px, int py, int dir) addEntityToList(newItemEntity(newItem(ITEM_DIRT,1), (x<<4)+8, (y<<4)+8, currentLevel), &eManager); setTile(TILE_HOLE,x,y); return 1; + }else if(item->id == ITEM_STONE){ + setTile(TILE_ROCK,x,y); + --item->countLevel; } break; case TILE_HOLE: case TILE_WATER: