[-] Another fix for bug 1424945

This commit is contained in:
cybermind 2015-02-26 23:46:27 +05:00
parent 7cb2a8f9a4
commit ece63c1f0d
2 changed files with 5 additions and 3 deletions

View file

@ -293,7 +293,9 @@ bool COrder_Still::AutoAttackStand(CUnit &unit)
if (autoAttackUnit == NULL) {
return false;
}
if (unit.MapDistanceTo(*autoAttackUnit) > unit.Stats->Variables[ATTACKRANGE_INDEX].Max) {
// If unit is removed, use containers x and y
const CUnit *firstContainer = unit.Container ? unit.Container : &unit;
if (firstContainer->MapDistanceTo(*autoAttackUnit) > unit.Stats->Variables[ATTACKRANGE_INDEX].Max) {
return false;
}
if (GameSettings.Inside && CheckObstaclesBetweenTiles(unit.tilePos, autoAttackUnit->tilePos, MapFieldRocks | MapFieldForest) == false) {

View file

@ -439,9 +439,9 @@ public:
bool BigScreen; /// If true, shows the big screen(without panels)
bool PauseOnLeave; /// If true, game pauses when cursor is gone
bool AiExplores; /// If true, AI sends explorers to search for resources (almost useless thing)
bool GrayscaleIcons; /// Use grayscaled icons for unavailable units, upgrades, etc
bool GrayscaleIcons; /// Use grayscaled icons for unavailable units, upgrades, etc
bool IconsShift; /// Shift icons slightly when you press on them
bool StereoSound; /// Enables/diables stereo sound effects
bool StereoSound; /// Enables/disables stereo sound effects
bool MineNotifications; /// Show mine is running low/depleted messages
int ShowOrders; /// How many second show orders of unit on map.