Fixed defense_on function causing errors...
...while trying to get defense value on unpassable terrain
This commit is contained in:
parent
7251e8599b
commit
2494ec741c
1 changed files with 6 additions and 0 deletions
|
@ -945,6 +945,9 @@ private:
|
|||
{
|
||||
const unit& un = u_call->get_unit();
|
||||
|
||||
if( un.total_movement() < un.movement_cost( ai_.get_info().map[loc]) )
|
||||
return variant();
|
||||
|
||||
if(!ai_.get_info().map.on_board(loc)) {
|
||||
return variant();
|
||||
}
|
||||
|
@ -955,6 +958,9 @@ private:
|
|||
if (u_type)
|
||||
{
|
||||
const unit_type& un = u_type->get_unit_type();
|
||||
|
||||
if( un.movement() < un.movement_type().movement_cost(ai_.get_info().map, ai_.get_info().map[loc]) )
|
||||
return variant();
|
||||
|
||||
if(!ai_.get_info().map.on_board(loc)) {
|
||||
return variant();
|
||||
|
|
Loading…
Add table
Reference in a new issue