Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh committed Sep 2, 2024
1 parent 6d510ed commit 4d0a313
Show file tree
Hide file tree
Showing 70 changed files with 1,134 additions and 1,071 deletions.
22 changes: 11 additions & 11 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,11 +1449,11 @@ std::vector<std::pair<Position, std::vector<uint32_t>>> Combat::pickChainTargets
phmap::flat_hash_set<uint32_t> visited;

if (initialTarget && initialTarget != caster) {
targets.push_back(initialTarget);
targets.emplace_back(initialTarget);
visited.insert(initialTarget->getID());
resultMap.push_back({ caster->getPosition(), { initialTarget->getID() } });
resultMap.emplace_back(caster->getPosition(), std::vector<uint32_t> { initialTarget->getID() });
} else {
targets.push_back(caster);
targets.emplace_back(caster);
maxTargets++;
}

Expand Down Expand Up @@ -1493,10 +1493,10 @@ std::vector<std::pair<Position, std::vector<uint32_t>>> Combat::pickChainTargets
}
}
if (!found) {
resultMap.push_back({ currentTarget->getPosition(), { closestSpectator->getID() } });
resultMap.emplace_back(currentTarget->getPosition(), std::vector<uint32_t> { closestSpectator->getID() });
}

targets.push_back(closestSpectator);
targets.emplace_back(closestSpectator);
visited.insert(closestSpectator->getID());
continue;
}
Expand Down Expand Up @@ -2010,11 +2010,11 @@ void AreaCombat::setupArea(int32_t length, int32_t spread) {

for (int32_t x = 1; x <= cols; ++x) {
if (y == rows && x == ((cols - (cols % 2)) / 2) + 1) {
list.push_back(3);
list.emplace_back(3);
} else if (x >= mincol && x <= maxcol) {
list.push_back(1);
list.emplace_back(1);
} else {
list.push_back(0);
list.emplace_back(0);
}
}

Expand Down Expand Up @@ -2048,11 +2048,11 @@ void AreaCombat::setupArea(int32_t radius) {
for (auto &row : area) {
for (const int cell : row) {
if (cell == 1) {
list.push_back(3);
list.emplace_back(3);
} else if (cell > 0 && cell <= radius) {
list.push_back(1);
list.emplace_back(1);
} else {
list.push_back(0);
list.emplace_back(0);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/creatures/combat/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ bool ConditionDamage::unserializeProp(ConditionAttr_t attr, PropStream &propStre
return false;
}

damageList.push_back(damageInfo);
damageList.emplace_back(damageInfo);
if (ticks != -1) {
setTicks(ticks + damageInfo.interval);
}
Expand Down Expand Up @@ -1563,7 +1563,7 @@ bool ConditionDamage::addDamage(int32_t rounds, int32_t time, int32_t value) {
damageInfo.timeLeft = time;
damageInfo.value = value;

damageList.push_back(damageInfo);
damageList.emplace_back(damageInfo);

if (ticks != -1) {
setTicks(ticks + damageInfo.interval);
Expand Down Expand Up @@ -1819,7 +1819,7 @@ void ConditionDamage::generateDamageList(int32_t amount, int32_t start, std::lis

do {
sum += i;
list.push_back(i);
list.emplace_back(i);

x1 = std::fabs(1.0 - ((static_cast<float>(sum)) + i) / med);
x2 = std::fabs(1.0 - (static_cast<float>(sum) / med));
Expand Down
Loading

0 comments on commit 4d0a313

Please sign in to comment.