[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Update of bug #18736 (project freeciv): Status: Ready For Test = Fixed Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Update of bug #18736 (project freeciv): Release: = 2.3.1 ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Update of bug #18736 (project freeciv): Status: In Progress = Ready For Test ___ Follow-up Comment #12: Patches attached. Trunk/S2_4 version adds an assertion that should make this sort of thing easier to diagnose in future. (file #15360, file #15361) ___ Additional Item Attachment: File name: trunk-S2_4-obsolete-unit-skipped.diff Size:2 KB File name: S2_3-obsolete-unit-skipped.diff Size:2 KB ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #9, bug #18736 (project freeciv): See also bug #18816. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Update of bug #18736 (project freeciv): Status:None = In Progress Assigned to:None = jtn Operating System: Microsoft Windows = Any Planned Release: 2.3.2,2.4.0 = 2.3.2,2.4.0,2.5.0 ___ Follow-up Comment #10: Yeah, pretty obvious now I come to stare at the code again. In city_build_unit(): utype = pcity-production.value.utype; unit_shield_cost = utype_build_shield_cost(utype); upgrade_unit_prod(pcity); upgrade_unit_prod() changes pcity-production.value.utype (and indeed we see Production of Horsemen is upgraded to Knights in 22 in the reproduction case), but then the cached utype and unit_shield_cost are used throughout the rest of the function, and the upgraded utype isn't referred to. But functions _called by_ city_build_unit() on pcity do see the upgraded unit, and that includes city_production_build_units(), which determines how many units to build. Since the shield cost of the upgraded unit is greater, it returns 0 (which normally it would never do). But since we passed the so are we building some units then test in city_build_unit() (based on the cached data), we end up calling choose_build_target() after building 0 units. The obvious rearrangement fixes the basic problem. Need to think a bit about the policy. I'm kind of tempted to special-case buying -- you hurried a Phalanx last turn, you get a Phalanx, regardless of whether your RD allows you to build Pikemen now. (Too harsh?) (Since city_production_build_units() is implicated, which is a build-slots-related function, this could be a regression since 2.2.x -- haven't checked yet. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #11, bug #18736 (project freeciv): From inspection, bug indeed doesn't apply to S2_2 (which doesn't have the ordering problem in the first place); it came in with patch #1234. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #4, bug #18736 (project freeciv): I already had a brief stare at the code with this bug (cluster of tickets) in mind and didn't spot how it could happen. A reproduction case with a savegame would help. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #5, bug #18736 (project freeciv): it is so complicated to reproduce, that i will not do so and would not recommend to do it to anyone else. - load before - go to city 22 - buy horsemen - activate end of turn (file #14714, file #14715) ___ Additional Item Attachment: File name: freeciv-T0142-Y00840-manual-before.sav.bz2 Size:52 KB File name: freeciv-T0143-Y00860-auto-after.sav.bz2 Size:51 KB ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #6, bug #18736 (project freeciv): oh and in 2.3.1 ten of twenty shields are ... gone ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Update of bug #18736 (project freeciv): Planned Release: = 2.3.2,2.4.0 ___ Follow-up Comment #7: Sarcasm? No matter, I've reproduced it (with head of S2_3). * Horsemen have already been bought in 22 in savegame * Hit Turn Done * Chivalry acquired from Great Library! * In 22, Horsemen are nowhere to be seen. * Instead, the city is 16 into an Aqueduct. Given that it has 6 production/turn, it seems that the change-from-unit-to-building penalty has been applied (20-10). If I change the worklist so that the next item is e.g. Caravan, all 20 shields go towards that. This ought to give us enough to find the issue. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #8, bug #18736 (project freeciv): what do you mean with Sarcasm?? and what means with head of S2_3? yea, i accidently saved after buying horsemen. the one without my mistake: (file #14718) ___ Additional Item Attachment: File name: freeciv-T0142-Y00840-manual-before.sav.bz2 Size:52 KB ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #3, bug #18736 (project freeciv): OK, this one seems more active than the other (bug #17441) I searched with 'upgrade'... Verified this as explained with bug #17441. To fix, trigger production upgrade when new tech is received. Thus, player cannot buy obsolete units. Or if fixing the mechanics itself, production should continue from the amount of shields that were achieved prior to upgrade, bought or otherwise. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #1, bug #18736 (project freeciv): Sounds horribly plausible, although I haven't tested it or verified it from the code. What do we think should happen in this situation (bought Horsemen, but tech discovery makes them obsolete before they're created)? In particular, what if the new unit is more expensive? Should the bought flag be reset and production just carry on? Nasty if you were hoping for the bought unit (however obsolete) to defend a city that turn... Or should you just get the now-obsolete unit you originally bought anyway? ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
Follow-up Comment #2, bug #18736 (project freeciv): I think, you should get the upgraded unit at same shield cost, and the obsolete unit if the shield cost is greater. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18736] building unit is skipped when replaced in same round
URL: http://gna.org/bugs/?18736 Summary: building unit is skipped when replaced in same round Project: Freeciv Submitted by: gaymmaster Submitted on: Mo 26 Sep 2011 02:46:40 GMT Category: None Severity: 3 - Normal Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: Discussion Lock: Any Operating System: Microsoft Windows Planned Release: ___ Details: Freeciv-2.3.0-gtk2 Chat: You bought Horsemen in [CITY]. [click done!/new round] Die Inder haben Rittertum erforscht. [others got knighthood] Du hast Rittertum von den die Große Bibliothek übernommen! [i got knighthood via great library] Anstatt Reiter wird Ritter produziert (in [CITY]). [instead of horsemen, knight will be produced] [CITY] baut Arbeiter aus der Arbeitsliste. [worker from the list will be produced next] but there is no horsemen/knight. finishing that unit is skipped, next unit from the worklist is being produced with the 20 production ressources from last round/horsemen. ___ Reply to this item at: http://gna.org/bugs/?18736 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev