src/players.cpp
// This function increments the score of a player

This function increments the score of a player
This function increments the score of a player
bool playerIncrementScoreForHit(gameObjectPointerStruct& unitP, double extraScore) {
	vectorListNodeStruct<playerUnitStruct>* player;
	if (unitP.objectType!=FILE_GAMEDATA_GAMEOBJECT_PLAYER)
		return false;
	player=playerList.getNode(unitP.listIndex);
	if (player->data.id!=unitP.id || player->data.energyLeft<=0 ||
		!player->data.nowActive) {
		return true;
	}
	player->data.score+=extraScore;
	gameWorld.scoreInHits+=(int)extraScore;
	return true;
}
bool playerIncrementScoreForHit ( gameObjectPointerStruct & unitP , double extraScore ) { vectorListNodeStruct < playerUnitStruct > * player ; if ( unitP . objectType != FILE_GAMEDATA_GAMEOBJECT_PLAYER ) return false ; player = playerList . getNode ( unitP . listIndex ) ; if ( player -> data . id != unitP . id || player -> data . energyLeft <= 0 || ! player -> data . nowActive ) { return true ; } player -> data . score += extraScore ; gameWorld . scoreInHits += ( int ) extraScore ; return true ; }
This function increments the score of a player
This function increments the score of a player
// check for unitP actually being a player, if it's not, it's
 // been an error.
 // Now check for it being the player it's supposed to be, and for
 // it being a correct player to increment the score
 // I can't increment this player score, neither it's been a
 // real error
 // all ok
 // Increment the score
 // save the statistic
 // all ok
