Aivolution:

-check if found player base before attacking it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4457 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2008-03-31 22:33:35 +00:00
parent e881fe7f14
commit c8be736b57
1 changed files with 14 additions and 2 deletions

View File

@ -9337,6 +9337,12 @@ function bool canStartAttack(int _enemy)
return(FALSE);
}
// make sure we found enemy base
if(curBase[_enemy][0] < 0 or curBase[_enemy][1] < 0)
{
return false;
}
return(TRUE);
}
@ -12316,7 +12322,13 @@ function void prepareAttackers(bool _bHighPriorityTask)
function void startAttack(int _enemy, int _x, int _y)
{
if(_enemy < 0){MsgBox("startAttack - _enemy < 0"); return;}
if(_enemy < 0)
{
stopAttack();
MsgBox("startAttack - enemy (" & _enemy & ") < 0");
return;
}
if((_x <= 0) or (_y <= 0)){MsgBox("startAttack - enemy coords < 0"); return;}
//if(not knowBase[enemy]){MsgBox("startAttack - knowBase[enemy] == FALSE"); return;}
@ -12556,7 +12568,7 @@ function void doAttack()
return;
}
if((curBase[enemy][0] <= 0) or (curBase[enemy][1] <= 0)){MsgBox("doAttack - enemy coords < 0"); return;}
if((curBase[enemy][0] <= 0) or (curBase[enemy][1] <= 0)){MsgBox("doAttack - enemy (" & enemy & ")coords < 0"); return;}