Page 1 of 1

Where do I get Droid damage from loop.cpp file

Posted: 06 Nov 2013, 03:57
by jh0242
I am working in the gameStateUpdate function within the loop.cpp file and I know that it iterates through the droid list at the for loop starting at line 612. I know the health stat is body, but I can't seem to find the variable for the damage that the droid does with each shot. Is it just poorly named or how would I go about retrieving the variable?

What would I do at the point I have marked to find each DROID's damage?

for (unsigned i = 0; i < MAX_PLAYERS; i++)
{
//update the current power available for a player
updatePlayerPower(i);

DROID *psNext;
for (DROID *psCurr = apsDroidLists; psCurr != NULL; psCurr = psNext)
{
// Copy the next pointer - not 100% sure if the droid could get destroyed but this covers us anyway
Working here ----> psCurr->(what?)
psNext = psCurr->psNext;
droidUpdate(psCurr);
}

Re: Where do I get Droid damage from loop.cpp file

Posted: 06 Nov 2013, 05:16
by vexed
Hmm ? Damage is calculated, depending on what weapon they got...

Re: Where do I get Droid damage from loop.cpp file

Posted: 06 Nov 2013, 05:46
by jh0242
vexed wrote:Hmm ? Damage is calculated, depending on what weapon they got...
That's what I thought, but when I have done psCurr->asWeaps, there is no variable for damage. At least not declared in a comment or an explicitly named variable. As I see it, the droid can hold up to three weapons, but I still don't see where the damage is defined. Sorry if I'm missing something easy or making a stupid mistake.