Where do I get Droid damage from loop.cpp file

For code related discussions and questions
Post Reply
jh0242
Rookie
Rookie
Posts: 18
Joined: 18 Apr 2013, 15:41

Where do I get Droid damage from loop.cpp file

Post 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);
}
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

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

Post by vexed »

Hmm ? Damage is calculated, depending on what weapon they got...
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
jh0242
Rookie
Rookie
Posts: 18
Joined: 18 Apr 2013, 15:41

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

Post 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.
Post Reply