Commit Message
This commit is contained in:
parent
6fcb731b31
commit
075b65c2ed
1 changed files with 12 additions and 23 deletions
|
@ -116,7 +116,6 @@ if(obj_inv_controller.is_open)
|
||||||
}
|
}
|
||||||
|
|
||||||
var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot];
|
var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot];
|
||||||
var has_colision = false;
|
|
||||||
|
|
||||||
if(selected_item != 0)
|
if(selected_item != 0)
|
||||||
{
|
{
|
||||||
|
@ -124,33 +123,23 @@ if(selected_item != 0)
|
||||||
var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE;
|
var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE;
|
||||||
selX -= TILE_SIZE / 2;
|
selX -= TILE_SIZE / 2;
|
||||||
selY -= TILE_SIZE / 2;
|
selY -= TILE_SIZE / 2;
|
||||||
|
|
||||||
for(var xx = selX; xx < selX + TILE_SIZE; xx++)
|
var objid = instance_position(selX,selY,obj_placed_item)
|
||||||
{
|
if(objid != noone)
|
||||||
for(yy = selY; yy < selY + TILE_SIZE; yy++)
|
|
||||||
{
|
|
||||||
var objid = instance_place(xx,yy,obj_placed_item)
|
|
||||||
if(objid != noone)
|
|
||||||
{
|
|
||||||
has_colision = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var objid = instance_place(xx,yy,obj_player)
|
|
||||||
if(objid != noone)
|
|
||||||
{
|
|
||||||
has_colision = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(has_colision)
|
|
||||||
{
|
{
|
||||||
|
show_debug_message(string(objid)+", "+string(objid.object_index));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
objid = instance_position(selX,selY,obj_player)
|
||||||
|
if(objid != noone)
|
||||||
|
{
|
||||||
|
show_debug_message(string(objid)+", "+string(objid.object_index));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_item_in_inventory(obj_hotbar.selected_slot);
|
|
||||||
var inst = instance_create(selX,selY,obj_placed_item);
|
var inst = instance_create(selX,selY,obj_placed_item);
|
||||||
|
use_item_in_inventory(obj_hotbar.selected_slot);
|
||||||
var chunkid = id;
|
var chunkid = id;
|
||||||
with(inst){
|
with(inst){
|
||||||
inst.ITEM_ID = selected_item;
|
inst.ITEM_ID = selected_item;
|
||||||
|
|
Reference in a new issue