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

@ -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
std::vector<std::string> selections = { "head", "body", "hand_l", "hand_r", "leg_l", "leg_r" };
std::vector<std::string>::iterator it = find(selections.begin(), selections.end(), selectionName);
if (it != selections.end())
std::vector<std::string> hitpoints = { "Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg" };
std::vector<std::string>::iterator it = find(hitpoints.begin(), hitpoints.end(), hitpointName);
if (it != hitpoints.end())
{
return it - selections.begin();
return it - hitpoints.begin();
}
else
{