任务单 #43682

Different handling of unitflag requirements with missing target unittype

开放日期: 2022-01-26 04:10 最后更新: 2022-02-08 23:53

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
1

Details

Unit type, unit class, and unit class flag requirements evaluate to TRI_YES when no target unittype is given. Unit flag requirements evaluate to TRI_MAYBE when no target unittype is given. This disparity was introduced fifteen years ago and apparently never documented in the code.

We should probably...

  • ...figure out whether unit type, class and class flag requirements still need to be true when in doubt – this is apparently a workaround introduced before requirement problem types (and later, tristate logic) were a thing, so it might not be necessary anymore
  • ...if yes, figure out whether unit type flag requirements still need to not be true when in doubt
  • ...if also yes, document the reasons in the code

任务单历史 (3/5 Histories)

2022-01-26 04:10 Updated by: alienvalkyrie
  • New Ticket "Different handling of unitflag requirements with missing target unittype" created
2022-01-31 06:12 Updated by: alienvalkyrie
评论

Reply To alienvalkyrie

* ...figure out whether unit type, class and class flag requirements still need to be true when in doubt – this is apparently a workaround introduced before requirement problem types (and later, tristate logic) were a thing, so it might not be necessary anymore

Haven't tried it yet, but after some history-poking, I think this workaround is no longer necessary. The original workaround was apparently only relevant for whether to draw city walls based on defend bonus effects, which has since been superseded by the Visible_Wall effect. So it should be fine to make those three also give TRI_MAYBE for a missing unittype.

Targetting this to S3_1, since technically – if there are any effects that are ever evaluated with an optional target unit (which I can't with certainty say there aren't) – this is a semantic change to the data file format.

2022-02-07 08:23 Updated by: alienvalkyrie
  • 属主 Update from (无) to alienvalkyrie
  • 处理结果 Update from to Accepted
评论

Currently running regression tests on this patch, since I don't think it should change anything.

2022-02-08 23:53 Updated by: alienvalkyrie
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名