FreeOrion

Forums for the FreeOrion project
It is currently Tue Jun 18, 2013 5:05 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [PATCH] Planet troops and defence meters broken
PostPosted: Mon Dec 26, 2011 11:49 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 805
Location: Sol III
Problem: With SVN 4541, planet troops and defence meters show an increase of 1 for the next turn, but never actually increase, but stay at 0.

The problem seems to be a typo in method Planet::PopGrowthProductionResearchPhase() in Planet.cpp:
Code:
GetMeter(METER_SHIELD)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_SHIELD));
GetMeter(METER_DEFENSE)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_SHIELD));
GetMeter(METER_TROOPS)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_SHIELD));

I'm fairly sure this shoud be:
Code:
GetMeter(METER_SHIELD)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_SHIELD));
GetMeter(METER_DEFENSE)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_DEFENSE));
GetMeter(METER_TROOPS)->SetCurrent(Planet::NextTurnCurrentMeterValue(METER_TROOPS));

Build SVN 4541 with this patch applied, ran a test game, troop and defence meters were working as they should again.

Patch file attached.


Attachments:
Planet_Meter_Growth.patch [719 Bytes]
Downloaded 10 times
Top
 Profile  
 
 Post subject: Re: [PATCH] Planet troops and defence meters broken
PostPosted: Tue Dec 27, 2011 12:37 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8050
Location: Vancouver, BC
Committed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group