[Freeciv-Dev] [bug #22363] Zero value effect evaluation zeroes total value of improvement

2014-07-22 Thread Marko Lindqvist
Update of bug #22363 (project freeciv):

  Status:  Ready For Test => Fixed  
 Assigned to:None => cazfi  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  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 #22363] Zero value effect evaluation zeroes total value of improvement

2014-07-19 Thread Marko Lindqvist
URL:
  

 Summary: Zero value effect evaluation zeroes total value of
improvement
 Project: Freeciv
Submitted by: cazfi
Submitted on: Sat 19 Jul 2014 11:59:31 AM EEST
Category: ai
Severity: 3 - Normal
Priority: 5 - Normal
  Status: Ready For Test
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 2.4.3, 2.5.0, 2.6.0

___

Details:

dai_effect_value() should not return only the value of the effect being
evalatuated, but it added to the base value calculated so far. The shortcut
that checks zero value effects returns 0 instead of unmodified old value.

Fix attached.

Not part of this patch, but I would prefer this to be changesd in trunk so
that dai_effect_value() returned value of the effect being evaluated. Current
interface may have made sense in some distant past, but currently it only
complicates things - the incoming old value is used for nothing but to be
added, so the addition would be as easily be done in caller side. In case of
present = FALSE effects caller needs to calculate the delta out of value that
went in to dai_effect_value() and value that came out.
And then there's the semantical point that function name no way indicate that
it returns something else than the value of the effect.



___

File Attachments:


---
Date: Sat 19 Jul 2014 11:59:31 AM EEST  Name: DaiEffectValueZero.patch  Size:
1kB   By: cazfi


---
Date: Sat 19 Jul 2014 11:59:31 AM EEST  Name: DaiEffectValueZero-S2_5.patch 
Size: 992B   By: cazfi



___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev