Skip to content

Commit

Permalink
Fix bug that swap body part and armor side
Browse files Browse the repository at this point in the history
  • Loading branch information
Yankes committed Feb 5, 2017
1 parent 1ea4348 commit b2125b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Extended.txt
Expand Up @@ -140,6 +140,7 @@ Add some missed scripts.[br/]
Add damage type param to unit damage script.[br/]
[br/]
3.6b:[br/]
Fix critical bug in unit damage function.[br/]
[br/]

[examples]
Expand Down
12 changes: 6 additions & 6 deletions src/Savegame/BattleUnit.cpp
Expand Up @@ -1160,16 +1160,16 @@ int BattleUnit::damage(Position relative, int power, const RuleDamageType *type,
work.execute(this->getArmor()->getEventUnitHitScript(), args);

power = args.getFirst();
side = (UnitSide)args.getSecond();
bodypart = (UnitBodyPart)args.getThird();
if (side >= SIDE_MAX)
{
side = {};
}
bodypart = (UnitBodyPart)args.getSecond();
side = (UnitSide)args.getThird();
if (bodypart >= BODYPART_MAX)
{
bodypart = {};
}
if (side >= SIDE_MAX)
{
side = {};
}
}

{
Expand Down

0 comments on commit b2125b7

Please sign in to comment.