The bad hack the "work harder" cheat was using did not play well with the power code. It now just marks the research as finished instead of giving lots of power and research time.

master
Gerard Krol 2009-04-24 14:11:24 +02:00
parent 0c694a22b0
commit af88a73dfc
2 changed files with 3 additions and 4 deletions

View File

@ -1357,13 +1357,11 @@ void kf_FinishResearch( void )
{
BASE_STATS *pSubject = NULL;
((RESEARCH_FACILITY *)psCurr->pFunctionality)->timeStarted = gameTime + 100000;
//set power accrued to high value so that will trigger straight away
((RESEARCH_FACILITY *)psCurr->pFunctionality)->powerAccrued = 10000;
// find out what the heck we are researching
// find out what we are researching here
pSubject = ((RESEARCH_FACILITY *)psCurr->pFunctionality)->psSubject;
if (pSubject)
{
researchResult((RESEARCH*)pSubject - asResearch, selectedPlayer, false, NULL);
sasprintf((char**)&cmsg, _("(Player %u) is using cheat :%s %s"),
selectedPlayer, _("Researched"), getName(pSubject->pName) );
sendTextMessage(cmsg, true);

View File

@ -3209,6 +3209,7 @@ static void aiUpdateStructure(STRUCTURE *psStructure, bool mission)
psResFacility->timeStarted = gameTime;
}
ASSERT_OR_RETURN(, gameTime >= psResFacility->timeStarted, "research seems to have started in the future");
pointsToAdd = (psResFacility->researchPoints * (gameTime -
psResFacility->timeStarted)) / GAME_TICKS_PER_SEC;