Fix remaining progress bar after research.

Was a missing popStatusPending().

Fixes ticket:2966.
master
Cyp 2011-12-08 13:13:26 +01:00
parent 0aeda2baa2
commit 4bf70ca7c5
3 changed files with 16 additions and 16 deletions

View File

@ -919,7 +919,7 @@ bool recvResearchStatus(NETQUEUE queue)
{
psResFacilty = (RESEARCH_FACILITY *) psBuilding->pFunctionality;
psResFacilty->psSubjectPending = NULL; // Research is no longer pending, as it's actually starting now.
popStatusPending(*psResFacilty); // Research is no longer pending, as it's actually starting now.
if (psResFacilty->psSubject)
{

View File

@ -300,21 +300,6 @@ void sendStructureInfo(STRUCTURE *psStruct, STRUCTURE_INFO structureInfo_, DROID
NETend();
}
template<typename Functionality>
static inline void popStatusPending(Functionality &functionality)
{
if (functionality.pendingCount == 0)
{
++functionality.pendingCount;
}
if (--functionality.pendingCount == 0)
{
// Subject is now synchronised, remove pending.
functionality.psSubjectPending = NULL;
functionality.statusPending = FACTORY_NOTHING_PENDING;
}
}
void recvStructureInfo(NETQUEUE queue)
{
uint8_t player = 0;

View File

@ -497,6 +497,21 @@ static inline void setStatusPendingRelease(Functionality &functionality)
++functionality.pendingCount;
}
template<typename Functionality>
static inline void popStatusPending(Functionality &functionality)
{
if (functionality.pendingCount == 0)
{
++functionality.pendingCount;
}
if (--functionality.pendingCount == 0)
{
// Subject is now synchronised, remove pending.
functionality.psSubjectPending = NULL;
functionality.statusPending = FACTORY_NOTHING_PENDING;
}
}
void checkStructure(const STRUCTURE* psStructure, const char * const location_description, const char * function, const int recurse);
#define CHECK_STRUCTURE(object) checkStructure((object), AT_MACRO, __FUNCTION__, max_check_object_recursion)