diff --git a/objects/obj_chunk.object.gmx b/objects/obj_chunk.object.gmx index 7b14ad1..015a121 100644 --- a/objects/obj_chunk.object.gmx +++ b/objects/obj_chunk.object.gmx @@ -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){ diff --git a/objects/obj_placed_item.object.gmx b/objects/obj_placed_item.object.gmx index 6d167c3..1a39432 100644 --- a/objects/obj_placed_item.object.gmx +++ b/objects/obj_placed_item.object.gmx @@ -84,6 +84,22 @@ image_index = ITEM_ID; </arguments> </action> </event> + <event eventtype="4" ename="obj_black_hole"> + <action> + <libid>1</libid> + <id>203</id> + <kind>0</kind> + <userelative>0</userelative> + <isquestion>0</isquestion> + <useapplyto>-1</useapplyto> + <exetype>1</exetype> + <functionname>action_kill_object</functionname> + <codestring></codestring> + <whoName>self</whoName> + <relative>0</relative> + <isnot>0</isnot> + </action> + </event> </events> <PhysicsObject>0</PhysicsObject> <PhysicsObjectSensor>0</PhysicsObjectSensor> diff --git a/objects/obj_player.object.gmx b/objects/obj_player.object.gmx index 66e4b4d..a6cfb2d 100644 --- a/objects/obj_player.object.gmx +++ b/objects/obj_player.object.gmx @@ -185,9 +185,9 @@ pull_towards_black_holes(); <kind>1</kind> <string>damage_player(5); instance_create(other.x,other.y,obj_boom_fx); - - -speed = -20; +image_angle += 180; +direction += 180; +speed = 20;