Opened 3 years ago

Closed 3 years ago

#4455 closed defect (fixed)

[PATCH] Correct a couple of incorrect assumptions in the structree

Reported by: s0600204 Owned by: s0600204
Priority: Should Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

wgoyc's problems with the recently rewritten technology requirements code highlighted a couple of assumptions within the code of the structree, namely

  • Assuming that a derived list of required techs doesn't contain a pair tech
  • Assuming that just because a unit has a production component, that it actually possesses lists of units/technologies to train/research

The attached patch resolves these assumptions, and also adds an error to display in the case that a tech/unit/structure requires a technology that is not included in any of that civ's units' or structures' production lists.

See https://wildfiregames.com/forum/index.php?/topic/21573-ugh-okay-help/

Attachments (2)

fixAssumptions.patch (3.5 KB) - added by s0600204 3 years ago.
Proposed patch
fixAssumptions_v1-1.patch (3.6 KB) - added by s0600204 3 years ago.

Download all attachments as: .zip

Change History (9)

Changed 3 years ago by s0600204

Attachment: fixAssumptions.patch added

Proposed patch

comment:1 Changed 3 years ago by elexis

  • template.cost && +template.cost[type] || 0 ?
  • sprintf only for translated strings

comment:2 Changed 3 years ago by s0600204

template.cost && +template.cost[type] || 0?

Complains about template.cost[type] being undefined.

+(template.cost && template.cost[type] || 0)

Works if that's preferable

Changed 3 years ago by s0600204

Attachment: fixAssumptions_v1-1.patch added

comment:3 Changed 3 years ago by fatherbushido

Can you upload it to phabricator? (we can't do it to not mess the author name)

comment:4 in reply to:  3 Changed 3 years ago by s0600204

Replying to fatherbushido:

Can you upload it to phabricator? (we can't do it to not mess the author name)

Done - https://code.wildfiregames.com/D113

comment:5 Changed 3 years ago by elexis

Keywords: rfc removed

Another revision proposal that could benefit from a review by wowgetoffyourcellphone

comment:6 Changed 3 years ago by elexis

Milestone: Work In ProgressAlpha 22

Fixed by r19213, thanks for the patch!

comment:7 Changed 3 years ago by elexis

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.