bugs in CGlobalAICallback

bugs in CGlobalAICallback

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

bugs in CGlobalAICallback

Post by jcnossen »

This:

Code: Select all


const vector<CommandDescription>* CGlobalAICallback::GetUnitCommands(int unitid)
{
if(gs->teams[ai->team]->units.find(uh->units[unitid])==gs->teams[ai->team]->units.end()){
return &(uh->units[unitid]->commandAI->possibleCommands);
}
return 0;
}

const deque<Command>* CGlobalAICallback::GetCurrentUnitCommands(int unitid)
{
if(gs->teams[ai->team]->units.find(uh->units[unitid])==gs->teams[ai->team]->units.end()){
return &(uh->units[unitid]->commandAI->commandQue);
}
return 0;
}

should be

Code: Select all


const vector<CommandDescription>* CGlobalAICallback::GetUnitCommands(int unitid)
{
if(gs->teams[ai->team]->units.find(uh->units[unitid])!=gs->teams[ai->team]->units.end()){
return &(uh->units[unitid]->commandAI->possibleCommands);
}
return 0;
}

const deque<Command>* CGlobalAICallback::GetCurrentUnitCommands(int unitid)
{
if(gs->teams[ai->team]->units.find(uh->units[unitid])!=gs->teams[ai->team]->units.end()){
return &(uh->units[unitid]->commandAI->commandQue);
}
return 0;
}

(Notice the changing of == into != )
I suppose the purpose of units.find(...) is to prevent the AI from getting info about the units of other teams?

I was thinking, could I get sourceforge springrts access too?, so I can fix these little typos without spamming the forums....
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Isnt there a bug/patch submittion system at sourceforge for this sort of thing?
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Ok I will fix that.

We had planned to not give out CVS access to that many ppl so that we can check each patch for correctness. But if you apply a few more good patches I guess we will give you direct access to the CVS.

But as Altani said there is a bug/patch submition system on sourceforge if you dont want to post in the forums.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Altani?! Well at least I had a mention..
Post Reply

Return to “Engine”