Use hitpoints in medical extension (#4494)

This commit is contained in:
Glowbal 2016-10-02 09:41:17 +02:00 committed by GitHub
parent a54aec72bc
commit b4ab15bb47
2 changed files with 10 additions and 10 deletions

Binary file not shown.

View File

@ -78,7 +78,7 @@ namespace ace {
} }
} }
if (highestSpot == NULL) { if (highestSpot == NULL) {
break; break;
} }
int c = 0; int c = 0;
@ -94,10 +94,10 @@ namespace ace {
{ {
injuryToAdd = highestSpot; injuryToAdd = highestSpot;
} }
else else
{ {
int indexNewInjuryToAdd = rand() % information.size(); int indexNewInjuryToAdd = rand() % information.size();
injuryToAdd = information.at(indexNewInjuryToAdd); injuryToAdd = information.at(indexNewInjuryToAdd);
} }
int bodyPartID = selection; int bodyPartID = selection;
@ -105,7 +105,7 @@ namespace ace {
{ {
bodyPartID = rand() % 6; bodyPartID = rand() % 6;
} }
injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain); injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain);
injuriesToAdd.push_back(newWound); injuriesToAdd.push_back(newWound);
} }
@ -202,14 +202,14 @@ namespace ace {
} }
} }
int handleDamage::SelectionToNumber(const std::string& selectionName) int handleDamage::SelectionToNumber(const std::string& hitpointName)
{ {
// TODO use dynamic selections instead // TODO use dynamic selections instead
std::vector<std::string> selections = { "head", "body", "hand_l", "hand_r", "leg_l", "leg_r" }; std::vector<std::string> hitpoints = { "Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg" };
std::vector<std::string>::iterator it = find(selections.begin(), selections.end(), selectionName); std::vector<std::string>::iterator it = find(hitpoints.begin(), hitpoints.end(), hitpointName);
if (it != selections.end()) if (it != hitpoints.end())
{ {
return it - selections.begin(); return it - hitpoints.begin();
} }
else else
{ {