Commit Message
This commit is contained in:
parent
65013df7ed
commit
baa19120e7
3 changed files with 34 additions and 9 deletions
|
@ -110,29 +110,38 @@ if(distance_to_object(obj_player) > chunk_total_size*3)
|
|||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>///Place items
|
||||
if(obj_inv_controller.is_open)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot];
|
||||
var has_colision = false;
|
||||
|
||||
if(selected_item != 0)
|
||||
{
|
||||
use_item_in_inventory(obj_hotbar.selected_slot);
|
||||
var selX = round(mouse_x/TILE_SIZE)*TILE_SIZE;
|
||||
var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE;
|
||||
selX -= TILE_SIZE / 2;
|
||||
selY -= TILE_SIZE / 2;
|
||||
|
||||
var has_colision = false;
|
||||
|
||||
for(var xx = selX; xx < selX + TILE_SIZE; xx++)
|
||||
{
|
||||
for(yy = selY; yy < selY + TILE_SIZE; yy++)
|
||||
{
|
||||
var objid = instance_place(xx,yy,all)
|
||||
if(objid != noone && objid.object_index != obj_chunk)
|
||||
var objid = instance_place(xx,yy,obj_placed_item)
|
||||
if(objid != noone)
|
||||
{
|
||||
has_colision = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(has_colision)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
use_item_in_inventory(obj_hotbar.selected_slot);
|
||||
var inst = instance_create(selX,selY,obj_placed_item);
|
||||
var chunkid = id;
|
||||
with(inst){
|
||||
|
|
Reference in a new issue