diff options
Diffstat (limited to 'src/resources/item')
-rw-r--r-- | src/resources/item/itemoption.h | 4 | ||||
-rw-r--r-- | src/resources/item/itemoptionslist.h | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/resources/item/itemoption.h b/src/resources/item/itemoption.h index 5d993c8d6..c4327622a 100644 --- a/src/resources/item/itemoption.h +++ b/src/resources/item/itemoption.h @@ -25,7 +25,9 @@ struct ItemOption final { - ItemOption() + ItemOption() : + index(0U), + value(0) { } A_DELETE_COPY(ItemOption) diff --git a/src/resources/item/itemoptionslist.h b/src/resources/item/itemoptionslist.h index 7bb259028..725340f45 100644 --- a/src/resources/item/itemoptionslist.h +++ b/src/resources/item/itemoptionslist.h @@ -31,7 +31,8 @@ struct ItemOptionsList final { - explicit ItemOptionsList(const int amount0) : + explicit ItemOptionsList(const size_t amount0) : + options(nullptr), amount(amount0), pointer(0U) { @@ -39,6 +40,7 @@ struct ItemOptionsList final } ItemOptionsList() : + options(nullptr), amount(maxItemOptions), pointer(0U) { @@ -68,9 +70,9 @@ struct ItemOptionsList final if (options0 == nullptr) return nullptr; - const int amount0 = options0->amount; + const size_t amount0 = options0->amount; ItemOptionsList *const obj = new ItemOptionsList(amount0); - for (int f = 0; f < amount0; f ++) + for (size_t f = 0; f < amount0; f ++) { obj->options[f].index = options0->options[f].index; obj->options[f].value = options0->options[f].value; |