Opened 7 years ago

Closed 7 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 7 years ago.
Proposed patch
fixAssumptions_v1-1.patch (3.6 KB ) - added by s0600204 7 years ago.

Download all attachments as: .zip

Change History (9)

by s0600204, 7 years ago

Attachment: fixAssumptions.patch added

Proposed patch

comment:1 by elexis, 7 years ago

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

comment:2 by s0600204, 7 years ago

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

Complains about template.cost[type] being undefined.

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

Works if that's preferable

by s0600204, 7 years ago

Attachment: fixAssumptions_v1-1.patch added

comment:3 by fatherbushido, 7 years ago

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

in reply to:  3 comment:4 by s0600204, 7 years ago

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 by elexis, 7 years ago

Keywords: rfc removed

Another revision proposal that could benefit from a review by wowgetoffyourcellphone

comment:6 by elexis, 7 years ago

Milestone: Work In ProgressAlpha 22

Fixed by r19213, thanks for the patch!

comment:7 by elexis, 7 years ago

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