@@ -312,10 +312,10 @@ class Main #if openfl extends Sprite #end
312312 }
313313 if (Bind .playerUse .bool )
314314 {
315- // program.use(selectX,selectY);
316- // player.hold();
315+ program .use (selectX ,selectY );
316+ player .hold ();
317317 // animation section
318- var tile : Tile = null ;
318+ /* var tile:Tile = null;
319319 var animation = objects.objectMap.get(player.instance.po_id).animation;
320320 trace(" map " + animation);
321321 if (animation != null)
@@ -330,7 +330,7 @@ class Main #if openfl extends Sprite #end
330330 i++;
331331 }
332332 }
333- }
333+ }*/
334334 // var record = map.animation.record;
335335 /* for (i in 0...record.params.length)
336336 {
@@ -347,6 +347,11 @@ class Main #if openfl extends Sprite #end
347347 {
348348 // fix crash
349349 if (player == null ) return ;
350+ if (Bind .command )
351+ {
352+ mouseRightDown (null );
353+ return ;
354+ }
350355 if (Bind .playerMove .bool )
351356 {
352357 program .path (selectX ,selectY );
@@ -486,20 +491,22 @@ class Main #if openfl extends Sprite #end
486491 // add object arraqy
487492 public function add (array : Array <Int >,x : Int ,y : Int ,container : Bool = false ,push : Bool = true )
488493 {
489- var sub : TileContainer = null ;
490494 if (array != null )
491495 {
492496 objects .add (array [0 ],x ,y ,array .length > 1 ? true : container ,push );
493497 objects .containing = array .length > 1 ? array [0 ] : 0 ;
498+ var index : Int = 0 ;
494499 for (i in 1 ... array .length )
495500 {
496501 if (array [i ] < 0 )
497502 {
498503 // sub container
499- objects .add (array [i ] * - 1 ,x ,y ,true ,push );
504+ objects .add (array [i ] * - 1 ,x ,y ,true ,push ,index );
505+ index ++ ;
500506 }else {
501507 // container
502508 objects .add (array [i ],x ,y ,container ,push );
509+ index = 0 ;
503510 }
504511 }
505512 }
0 commit comments