External iterators for player items

Implements external iterators for player items.
This commit is contained in:
Gleb Mazovetskiy 2021-08-27 14:01:01 +01:00 committed by Anders Jenbo
commit 032eaf7491
4 changed files with 300 additions and 31 deletions

View file

@ -17,6 +17,7 @@
#include "error.h"
#include "init.h"
#include "inv.h"
#include "inv_iterators.hpp"
#include "lighting.h"
#include "minitext.h"
#include "missiles.h"
@ -2678,7 +2679,7 @@ bool OperateShrineGloomy(int pnum)
auto &player = Players[pnum];
// Increment armor class by 2 and decrements max damage by 1.
ForEachInventoryItem(player, [](ItemStruct &item) {
for (ItemStruct &item : PlayerItemsRange(player)) {
switch (item._itype) {
case ITYPE_SWORD:
case ITYPE_AXE:
@ -2699,7 +2700,7 @@ bool OperateShrineGloomy(int pnum)
default:
break;
}
});
}
InitDiabloMsg(EMSG_SHRINE_GLOOMY);