Fixed defense_on function causing errors...

...while trying to get defense value on unpassable terrain
This commit is contained in:
Bartek Waresiak 2009-03-19 21:03:25 +00:00
parent 7251e8599b
commit 2494ec741c

View file

@ -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();