Ticket #2131: hero.diff
File hero.diff, 1.3 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/gui/session/session.js
468 468 g_Selection.reset(); 469 469 g_Selection.addList([hero]); 470 470 }; 471 heroButton.ondoublepress = function() { selectAndMoveTo( hero) };471 heroButton.ondoublepress = function() { selectAndMoveTo(getEntityOrHolder(hero)) }; 472 472 heroButton.hidden = false; 473 473 474 474 // Setup tooltip -
binaries/data/mods/public/gui/session/utility_functions.js
573 573 574 574 return tooltip; 575 575 } 576 577 /** 578 * Returns the entity itself except when garrisoned where it returns its garrisonHolder 579 */ 580 function getEntityOrHolder(ent) 581 { 582 var entState = GetEntityState(ent); 583 if (entState && !entState.position) 584 if (entState.unitAI && entState.unitAI.orders.length > 0 && entState.unitAI.orders[0].type == "Garrison") 585 return entState.unitAI.orders[0].data.target; 586 587 return ent; 588 }