Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting CheckInvPaste() into smaller functions #6984

Merged
2 changes: 1 addition & 1 deletion Source/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ void DrawInfoBox(const Surface &out)
GetObjectStr(*ObjectUnderCursor);
if (pcursmonst != -1) {
if (leveltype != DTYPE_TOWN) {
const auto &monster = Monsters[pcursmonst];
const Monster &monster = Monsters[pcursmonst];
InfoColor = UiFlags::ColorWhite;
InfoString = monster.name();
if (monster.isUnique()) {
Expand Down
6 changes: 3 additions & 3 deletions Source/controls/plrctrls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void FindItemOrObject()

continue;
}
auto &item = Items[itemId];
Item &item = Items[itemId];
if (item.isEmpty() || item._iSelFlag == 0) {
continue;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ void FindRangedTarget()

for (size_t i = 0; i < ActiveMonsterCount; i++) {
int mi = ActiveMonsters[i];
const auto &monster = Monsters[mi];
const Monster &monster = Monsters[mi];

if (!CanTargetMonster(monster))
continue;
Expand Down Expand Up @@ -332,7 +332,7 @@ void FindMeleeTarget()

if (dMonster[dx][dy] != 0) {
const int mi = std::abs(dMonster[dx][dy]) - 1;
const auto &monster = Monsters[mi];
const Monster &monster = Monsters[mi];
if (CanTargetMonster(monster)) {
const bool newCanTalk = CanTalkToMonst(monster);
if (pcursmonst != -1 && !canTalk && newCanTalk)
Expand Down
2 changes: 1 addition & 1 deletion Source/controls/touch/renderers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ VirtualGamepadButtonType PrimaryActionButtonRenderer::GetTownButtonType()
VirtualGamepadButtonType PrimaryActionButtonRenderer::GetDungeonButtonType()
{
if (pcursmonst != -1) {
const auto &monster = Monsters[pcursmonst];
const Monster &monster = Monsters[pcursmonst];
if (M_Talker(monster) || monster.talkMsg != TEXT_NONE)
return GetTalkButtonType(virtualPadButton->isHeld);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ void UnstuckChargers()
}
}
for (size_t i = 0; i < ActiveMonsterCount; i++) {
auto &monster = Monsters[ActiveMonsters[i]];
Monster &monster = Monsters[ActiveMonsters[i]];
if (monster.mode == MonsterMode::Charge)
monster.mode = MonsterMode::Stand;
}
Expand All @@ -1400,7 +1400,7 @@ void UnstuckChargers()
void UpdateMonsterLights()
{
for (size_t i = 0; i < ActiveMonsterCount; i++) {
auto &monster = Monsters[ActiveMonsters[i]];
Monster &monster = Monsters[ActiveMonsters[i]];

if ((monster.flags & MFLAG_BERSERK) != 0) {
int lightRadius = leveltype == DTYPE_NEST ? 9 : 3;
Expand Down
Loading
Loading