#4728 closed defect (fixed)
Typo in MaxDistance in BuildRestrictions
Reported by: | PASilva | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
Hi, using the attached mod, where only the market template is changed by including the following BuildRestrictions:
<BuildRestrictions> <Category>Market</Category> <Distance> <FromClass>CivilCentre</FromClass> <MaxDistance>50</MaxDistance> </Distance> </BuildRestrictions>
it originates the following warning when placing the market:
JavaScript warning:simulation/components/BuildRestrictions.js line 302 reference to undefined property this.template.Distance.MinDistance
If, instead, we use <MinDistance>50</MinDistance> no warning is issued. Except for the warning, the simulation seems to run as expected on either way.
Don't know if this is related to #3529 .
Attachments (1)
Change History (4)
by , 7 years ago
Attachment: | strongholds_a22_teste.zip added |
---|
comment:1 by , 7 years ago
Keywords: | BuildRestrictions MaxDistance removed |
---|---|
Milestone: | Backlog → Alpha 23 |
Priority: | Nice to Have → Should Have |
Summary: | MaxDistance in BuildRestrictions warns → Typo in MaxDistance in BuildRestrictions |
Oh, are you kidding me, this is the bug Grugnas has discovered in march in Phab:D276, that I asked him to fix separately few days ago. Since it's a one-liner, going to commit that now.
MinDistance
is optional de jure, but the typo in the code tries to read from it when it intended to read from MaxDistance
.
Thanks for the ticket, that was missing (considering that the patch went nowhere).
comment:3 by , 7 years ago
Our templates are also correct and complete, because none use the MaxDistance
.
(If someone wants to improve it further, adding a test to catch this bug would have been the trve thing to do.)
example mod