Clean up 'work harder' cheat handling so that it does not confuse AI scripts.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9240 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-15 14:06:30 +00:00 committed by Git SVN Gateway
parent a9ba027836
commit 2f5eb36268
2 changed files with 12 additions and 7 deletions

View File

@ -1408,7 +1408,7 @@ void kf_FinishResearch( void )
pSubject = ((RESEARCH_FACILITY *)psCurr->pFunctionality)->psSubject;
if (pSubject)
{
researchResult((RESEARCH*)pSubject - asResearch, selectedPlayer, false, NULL);
researchResult((RESEARCH*)pSubject - asResearch, selectedPlayer, true, psCurr);
sasprintf((char**)&cmsg, _("(Player %u) is using cheat :%s %s"),
selectedPlayer, _("Researched"), getName(pSubject->pName) );
sendTextMessage(cmsg, true);

View File

@ -1766,16 +1766,21 @@ void researchResult(UDWORD researchIndex, UBYTE player, BOOL bDisplay,
}
}
if ((bMultiPlayer || player == selectedPlayer) && bDisplay)
{
psCBLastResearch = pResearch;
if (psResearchFacility)
{
psResearchFacility->pFunctionality->researchFacility.psSubject = NULL; // Make sure topic is cleared
}
if ((bMultiPlayer || player == selectedPlayer) && bDisplay)
{
debug(LOG_ERROR, "psResearchFacility=%p idle=%d", psResearchFacility, psResearchFacility ? (int)structureIdle(psResearchFacility) : -1);
psCBLastResearch = pResearch;
CBResFacilityOwner = player;
psCBLastResStructure = psResearchFacility;
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_RESEARCHCOMPLETED);
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_RESEARCHCOMPLETED);
psCBLastResStructure = NULL;
CBResFacilityOwner = -1;
CBResFacilityOwner = -1;
psCBLastResearch = NULL;
}
}
#ifdef DEBUG
/*this just checks that there are not more than 32 weapons now available for