Follow-up Comment #15, patch #3901 (project freeciv):

My branch has (and so my patch should have):


  if (is_non_allied_unit_tile(target, param->owner)
      && ( (uclass_has_flag(param->uclass, UCF_ATTACK_NON_NATIVE)
            && !BV_ISSET(param->unit_flags, UTYF_ONLY_NATIVE_ATTACK))
          || is_native_tile_to_class(param->uclass, target))
      && (uclass_has_flag(param->uclass, UCF_ATT_FROM_NON_NATIVE)
          || BV_ISSET(param->unit_flags, UTYF_MARINES)
          || is_native_tile_to_class(param->uclass, position)))


Your patch seems to have (at least when I created a branch from it):


  if (is_non_allied_unit_tile(target, param->owner)
      && (is_native_tile_to_class(param->uclass, target)
          || (uclass_has_flag(param->uclass, UCF_ATTACK_NON_NATIVE)
              && !BV_ISSET(param->unit_flags, UTYF_ONLY_NATIVE_ATTACK)))
      && (is_native_tile_to_class(param->uclass, position)
          || uclass_has_flag(param->uclass, UCF_ATT_FROM_NON_NATIVE)
          || BV_ISSET(param->unit_flags, UTYF_MARINES)))


    I was testing the flags for early-termination, but it makes the indenting
confusing.  When cleaning up the indentation, I suspect you made it easy to
read by reordering it.  I expect this causes every call to always check tile
nativity, even for units that don't care (unless there is some compiler
optimisation that means that conditional ordering doesn't actually matter, in
which case this isn't important at all), but I could be wrong.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3901>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to