project-navigation
Personal tools

Author Topic: [q] about stable v2.2.1: research code  (Read 2577 times)

Offline bfett14

  • Rookie
  • ***
  • Posts: 10
    • View Profile
[q] about stable v2.2.1: research code
« on: September 23, 2009, 04:01:54 am »
Found this piece in cl_research.c. It looks to me it never goes beyond first if().
Anybody can hint what was original intent here?

void RS_CheckAllCollected (void)
{
   int i;
   technology_t *tech = NULL;
   requirements_t *required = NULL;

   if (!required)
      return;

   if (!baseCurrent)

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: [q] about stable v2.2.1: research code
« Reply #1 on: September 23, 2009, 10:53:43 am »
Found this piece in cl_research.c. It looks to me it never goes beyond first if().
Anybody can hint what was original intent here?

In the latest revision, there is no function named like that. That must have been a bug.

-geever

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: [q] about stable v2.2.1: research code
« Reply #2 on: September 23, 2009, 12:31:14 pm »
He's not talking about the latest revision.

He's talking about the stable v2.2.1: research code.

This function originally was used to ensure that we looted all the items needed to be able to properly buy and sell things. It was called from cl_market.c "BS_BuyType_f" which was the init function for the buy and sell menu list. There was a todo on the call asking if it was even needed. I'm guessing not since in the latest revision, the function does not exist.

However, in v2.2.1, yes, the function is called, and yes, actually did nothing since it returns immediately on the first if statement.

I've noticed the developers tend to ignore anything older than the latest revision here in regards to the code. I recommend to play the ancient stable v2.2.1 if you just want to enjoy the game, but to not look at its code unless it is the latest revision of code. This is probably why Geever just looked at only the latest revision, and ... not much else. He is right though, just not verbose.
« Last Edit: September 23, 2009, 12:34:44 pm by criusmac »