From b353ae37eb6d374aec4127f1849a5dce81f812b5 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 24 Jun 2014 18:52:00 -0700 Subject: No one is .neutral() here (except IPv4 addresses) --- src/map/atcommand.cpp | 26 +++++-------- src/map/chrif.cpp | 6 +-- src/map/clif.cpp | 4 +- src/map/magic-expr.cpp | 10 ++--- src/map/magic-expr.hpp | 4 +- src/map/magic-stmt.cpp | 4 +- src/map/map.cpp | 6 +-- src/map/map.hpp | 14 +++---- src/map/mob.cpp | 6 +-- src/map/npc.cpp | 2 +- src/map/party.cpp | 4 +- src/map/pc.cpp | 100 +++++++++++++++++++++++++------------------------ src/map/pc.hpp | 2 +- src/map/script.cpp | 4 +- src/map/storage.cpp | 4 +- 15 files changed, 96 insertions(+), 100 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 6833b15..d2f154f 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1366,7 +1366,7 @@ ATCE atcommand_item(Session *s, dumb_ptr sd, } for (i = 0; i < number; i += get_count) { - struct item item_tmp {}; + Item item_tmp {}; item_tmp.nameid = item_id; PickupFail flag; if ((flag = pc_additem(sd, &item_tmp, get_count)) @@ -1457,10 +1457,9 @@ ATCE atcommand_baselevelup(Session *s, dumb_ptr sd, if (sd->status.status_point > 0) { for (i = 0; i > level; i--) - sd->status.status_point -= - (sd->status.base_level + i + 14) / 4; - if (sd->status.status_point < 0) - sd->status.status_point = 0; + sd->status.status_point -= std::min( + static_cast(sd->status.status_point), + (sd->status.base_level + i + 14) / 4); clif_updatestatus(sd, SP::STATUSPOINT); } // to add: remove status points from stats @@ -1521,9 +1520,7 @@ ATCE atcommand_joblevelup(Session *s, dumb_ptr sd, clif_updatestatus(sd, SP::NEXTJOBEXP); if (sd->status.skill_point > 0) { - sd->status.skill_point += level; - if (sd->status.skill_point < 0) - sd->status.skill_point = 0; + sd->status.skill_point += std::max(level, -sd->status.skill_point); clif_updatestatus(sd, SP::SKILLPOINT); } // to add: remove status points from skills @@ -2588,10 +2585,9 @@ ATCE atcommand_character_baselevel(Session *s, dumb_ptr sd, if (pl_sd->status.status_point > 0) { for (i = 0; i > level; i--) - pl_sd->status.status_point -= - (pl_sd->status.base_level + i + 14) / 4; - if (pl_sd->status.status_point < 0) - pl_sd->status.status_point = 0; + pl_sd->status.status_point -= std::min( + static_cast(pl_sd->status.status_point), + (pl_sd->status.base_level + i + 14) / 4); clif_updatestatus(pl_sd, SP::STATUSPOINT); } // to add: remove status points from stats @@ -2672,9 +2668,7 @@ ATCE atcommand_character_joblevel(Session *s, dumb_ptr sd, clif_updatestatus(pl_sd, SP::NEXTJOBEXP); if (pl_sd->status.skill_point > 0) { - pl_sd->status.skill_point += level; - if (pl_sd->status.skill_point < 0) - pl_sd->status.skill_point = 0; + pl_sd->status.skill_point += std::max(level, -pl_sd->status.skill_point); clif_updatestatus(pl_sd, SP::SKILLPOINT); } // to add: remove status points from skills @@ -3156,7 +3150,7 @@ ATCE atcommand_char_wipe(Session *s, dumb_ptr sd, } // Give knife and shirt - struct item item; + Item item; item.nameid = wrap(1201); pc_additem(pl_sd, &item, 1); item.nameid = wrap(1202); diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 3e20c3f..3a329f8 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -677,7 +677,7 @@ int chrif_saveaccountreg2(dumb_ptr sd) std::vector> repeat_10; for (size_t j = 0; j < sd->status.account_reg2_num; j++) { - struct global_reg *reg = &sd->status.account_reg2[j]; + GlobalReg *reg = &sd->status.account_reg2[j]; if (reg->str && reg->value != 0) { Packet_Repeat<0x2b10> info; @@ -918,7 +918,7 @@ int chrif_reloadGMdb(void) */ static -void ladmin_itemfrob_fix_item(ItemNameId source, ItemNameId dest, struct item *item) +void ladmin_itemfrob_fix_item(ItemNameId source, ItemNameId dest, Item *item) { if (item && item->nameid == source) { @@ -975,7 +975,7 @@ void ladmin_itemfrob_c2(dumb_ptr bl, ItemNameId source_id, ItemNameI case BL::MOB: { dumb_ptr mob = bl->is_mob(); - for (struct item& itm : mob->lootitemv) + for (Item& itm : mob->lootitemv) FIX(itm); break; } diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 3548324..2275023 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -1701,8 +1701,6 @@ not_b0: { case SP::ZENY: trade_verifyzeny(sd); - if (sd->status.zeny < 0) - sd->status.zeny = 0; fixed_b1.value = sd->status.zeny; break; @@ -2973,7 +2971,7 @@ int clif_party_info(PartyPair p, Session *s) head_fb.party_name = p->name; for (i = 0; i < MAX_PARTY; i++) { - struct party_member *m = &p->member[i]; + PartyMember *m = &p->member[i]; if (m->account_id) { Packet_Repeat<0x00fb> info; diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index 3631ca7..b0e68fb 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -135,7 +135,7 @@ AString show_entity(dumb_ptr entity) case BL::ITEM: assert (0 && "There is no way this code did what it was supposed to do!"_s); /* Sorry about this one... */ - // WTF? item_data is a struct item, not a struct item_data + // WTF? item_data is a Item, not a struct item_data // return ((struct item_data *) (&entity->is_item()->item_data))->name; abort(); case BL::SPELL: @@ -796,7 +796,7 @@ int fun_hash_entity(dumb_ptr, val_t *result, Slice args) } // ret -1: not a string, ret 1: no such item, ret 0: OK -int magic_find_item(Slice args, int index, struct item *item_, int *stackable) +int magic_find_item(Slice args, int index, Item *item_, int *stackable) { struct item_data *item_data; int must_add_sequentially; @@ -821,7 +821,7 @@ int magic_find_item(Slice args, int index, struct item *item_, int *stack if (stackable) *stackable = !must_add_sequentially; - *item_ = item(); + *item_ = Item(); item_->nameid = item_data->nameid; return 0; @@ -832,7 +832,7 @@ int fun_count_item(dumb_ptr, val_t *result, Slice args) { dumb_ptr chr = (ENTITY_TYPE(0) == BL::PC) ? ARGPC(0) : NULL; int stackable; - struct item item; + Item item; GET_ARG_ITEM(1, item, stackable); @@ -848,7 +848,7 @@ int fun_is_equipped(dumb_ptr, val_t *result, Slice args) { dumb_ptr chr = (ENTITY_TYPE(0) == BL::PC) ? ARGPC(0) : NULL; int stackable; - struct item item; + Item item; bool retval = false; GET_ARG_ITEM(1, item, stackable); diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp index 1c4d00e..c5c63a5 100644 --- a/src/map/magic-expr.hpp +++ b/src/map/magic-expr.hpp @@ -29,6 +29,8 @@ # include "../strings/zstring.hpp" # include "../strings/literal.hpp" +# include "../mmo/fwd.hpp" + # include "magic-interpreter.t.hpp" /* @@ -83,7 +85,7 @@ void magic_copy_var(val_t *dest, val_t *src); void magic_random_location(location_t *dest, dumb_ptr area); // ret -1: not a string, ret 1: no such item, ret 0: OK -int magic_find_item(Slice args, int index, struct item *item, int *stackable); +int magic_find_item(Slice args, int index, Item *item, int *stackable); # define GET_ARG_ITEM(index, dest, stackable) \ switch (magic_find_item(args, index, &dest, &stackable)) \ diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp index ae59ae7..2cfb43e 100644 --- a/src/map/magic-stmt.cpp +++ b/src/map/magic-stmt.cpp @@ -623,7 +623,7 @@ int op_override_attack(dumb_ptr env, Slice args) static int op_create_item(dumb_ptr, Slice args) { - struct item item; + Item item; dumb_ptr entity = ARGENTITY(0); dumb_ptr subject; int stackable; @@ -903,7 +903,7 @@ int op_set_hair_style(dumb_ptr, Slice args) static int op_drop_item_for (dumb_ptr, Slice args) { - struct item item; + Item item; int stackable; location_t *loc = &ARGLOCATION(0); int count = ARGINT(2); diff --git a/src/map/map.cpp b/src/map/map.cpp index dde617a..28d618b 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -697,7 +697,7 @@ std::pair map_searchrandfreecell(map_local *m, int x, int y, * item_dataはamount以外をcopyする *------------------------------------------ */ -BlockId map_addflooritem_any(struct item *item_data, int amount, +BlockId map_addflooritem_any(Item *item_data, int amount, map_local *m, int x, int y, dumb_ptr *owners, interval_t *owner_protection, interval_t lifetime, int dispersal) @@ -762,7 +762,7 @@ BlockId map_addflooritem_any(struct item *item_data, int amount, return fitem->bl_id; } -BlockId map_addflooritem(struct item *item_data, int amount, +BlockId map_addflooritem(Item *item_data, int amount, map_local *m, int x, int y, dumb_ptr first_sd, dumb_ptr second_sd, @@ -1658,7 +1658,7 @@ void term_func(void) map_close_logfile(); } -int compare_item(struct item *a, struct item *b) +int compare_item(Item *a, Item *b) { return (a->nameid == b->nameid); } diff --git a/src/map/map.hpp b/src/map/map.hpp index cbe8b27..7e61e56 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -473,7 +473,7 @@ struct mob_data : block_list }; // logically a map ... std::vector dmglogv; - std::vector lootitemv; + std::vector lootitemv; earray sc_data; short sc_count; @@ -524,8 +524,8 @@ struct map_local : map_abstract int npc_num; int users; MapFlags flag; - struct point save; - struct point resave; + Point save; + Point resave; Array, MAX_NPC_PER_MAP> npc; }; @@ -549,7 +549,7 @@ struct flooritem_data : block_list Timer cleartimer; BlockId first_get_id, second_get_id, third_get_id; tick_t first_get_tick, second_get_tick, third_get_tick; - struct item item_data; + Item item_data; }; extern interval_t autosave_time; @@ -619,11 +619,11 @@ void map_clearflooritem(BlockId id) { map_clearflooritem_timer(nullptr, tick_t(), id); } -BlockId map_addflooritem_any(struct item *, int amount, +BlockId map_addflooritem_any(Item *, int amount, map_local *m, int x, int y, dumb_ptr *owners, interval_t *owner_protection, interval_t lifetime, int dispersal); -BlockId map_addflooritem(struct item *, int, +BlockId map_addflooritem(Item *, int, map_local *, int, int, dumb_ptr, dumb_ptr, dumb_ptr); @@ -677,7 +677,7 @@ void map_deliddb(dumb_ptr bl); void map_addnickdb(dumb_ptr); int map_scriptcont(dumb_ptr sd, BlockId id); /* Continues a script either on a spell or on an NPC */ dumb_ptr map_nick2sd(CharName); -int compare_item(struct item *a, struct item *b); +int compare_item(Item *a, Item *b); dumb_ptr map_get_first_session(void); dumb_ptr map_get_last_session(void); diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 74e00be..336dbe7 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2179,7 +2179,7 @@ struct delay_item_drop2 { map_local *m; int x, y; - struct item item_data; + Item item_data; dumb_ptr first_sd, second_sd, third_sd; }; @@ -2190,7 +2190,7 @@ struct delay_item_drop2 static void mob_delay_item_drop(TimerData *, tick_t, struct delay_item_drop ditem) { - struct item temp_item {}; + Item temp_item {}; PickupFail flag; temp_item.nameid = ditem.nameid; @@ -2644,7 +2644,7 @@ int mob_damage(dumb_ptr src, dumb_ptr md, int damage, } { int i = 0; - for (struct item lit : md->lootitemv) + for (Item lit : md->lootitemv) { struct delay_item_drop2 ditem {}; ditem.item_data = lit; diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 7b31729..3232e4d 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -849,7 +849,7 @@ int npc_buylist(dumb_ptr sd, if ((item_data = itemdb_exists(item_l_id)) != NULL) { int amount = item_l_count; - struct item item_tmp {}; + Item item_tmp {}; item_tmp.nameid = item_data->nameid; diff --git a/src/map/party.cpp b/src/map/party.cpp index 5f69de5..24ce66a 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -544,7 +544,7 @@ void party_recv_movemap(PartyId party_id, AccountId account_id, MapName mapname, return; for (i = 0; i < MAX_PARTY; i++) { - struct party_member *m = &p->member[i]; + PartyMember *m = &p->member[i]; if (m == NULL) { PRINTF("party_recv_movemap nullpo?\n"_fmt); @@ -785,7 +785,7 @@ void party_foreachsamemap(std::function)> func, for (i = 0; i < MAX_PARTY; i++) { - struct party_member *m = &p->member[i]; + PartyMember *m = &p->member[i]; if (m->sd != NULL) { if (sd->bl_m != m->sd->bl_m) diff --git a/src/map/pc.cpp b/src/map/pc.cpp index e3a672e..4d104d1 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -948,7 +948,7 @@ int pc_calcstatus(dumb_ptr sd, int first) b_max_weight = sd->max_weight; earray b_paramb = sd->paramb; earray b_parame = sd->paramc; - earray b_skill = sd->status.skill; + earray b_skill = sd->status.skill; b_hit = sd->hit; b_flee = sd->flee; interval_t b_aspd = sd->aspd; @@ -1338,7 +1338,7 @@ int pc_calcstatus(dumb_ptr sd, int first) if (sd->sprate != 100) sd->status.max_sp = sd->status.max_sp * sd->sprate / 100; - if (sd->status.max_sp < 0 || sd->status.max_sp > battle_config.max_sp) + if (sd->status.max_sp > battle_config.max_sp) sd->status.max_sp = battle_config.max_sp; //自然回復HP @@ -1969,7 +1969,7 @@ int pc_remove_items(dumb_ptr player, ItemNameId item_id, int c * アイテム追加。個数のみitem構造体の数字を無視 *------------------------------------------ */ -PickupFail pc_additem(dumb_ptr sd, struct item *item_data, +PickupFail pc_additem(dumb_ptr sd, Item *item_data, int amount) { struct item_data *data; @@ -2047,7 +2047,7 @@ int pc_delitem(dumb_ptr sd, int n, int amount, int type) { if (bool(sd->status.inventory[n].equip)) pc_unequipitem(sd, n, CalcStatus::NOW); - sd->status.inventory[n] = item{}; + sd->status.inventory[n] = Item{}; sd->inventory_data[n] = NULL; } if (!(type & 1)) @@ -3017,6 +3017,8 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, } } + if (base_exp < 0 && -base_exp > sd->status.base_exp) + base_exp = -sd->status.base_exp; sd->status.base_exp += base_exp; // [Fate] Adjust experience points that healers can extract from this character @@ -3030,10 +3032,8 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, sd->heal_xp = max_heal_xp; } - if (sd->status.base_exp < 0) - sd->status.base_exp = 0; - - while (pc_checkbaselevelup(sd)); + while (pc_checkbaselevelup(sd)) + {} clif_updatestatus(sd, SP::BASEEXP); if (!battle_config.multi_level_up && pc_nextjobafter(sd)) @@ -3046,11 +3046,12 @@ int pc_gainexp_reason(dumb_ptr sd, int base_exp, int job_exp, } } + if (job_exp < 0 && -job_exp > sd->status.job_exp) + job_exp = -sd->status.job_exp; sd->status.job_exp += job_exp; - if (sd->status.job_exp < 0) - sd->status.job_exp = 0; - while (pc_checkjoblevelup(sd)); + while (pc_checkjoblevelup(sd)) + {} clif_updatestatus(sd, SP::JOBEXP); @@ -3471,52 +3472,48 @@ int pc_damage(dumb_ptr src, dumb_ptr sd, { if (battle_config.death_penalty_type == 1 && battle_config.death_penalty_base > 0) - sd->status.base_exp -= - static_cast(pc_nextbaseexp(sd)) * - static_cast(battle_config.death_penalty_base) / 10000; + sd->status.base_exp -= std::min(sd->status.base_exp, + static_cast(static_cast(pc_nextbaseexp(sd)) * + static_cast(battle_config.death_penalty_base) / 10000)); if (battle_config.pk_mode && src && src->bl_type == BL::PC) - sd->status.base_exp -= - static_cast(pc_nextbaseexp(sd)) * - static_cast(battle_config.death_penalty_base) / 10000; + sd->status.base_exp -= std::min(sd->status.base_exp, + static_cast(static_cast(pc_nextbaseexp(sd)) * + static_cast(battle_config.death_penalty_base) / 10000)); else if (battle_config.death_penalty_type == 2 && battle_config.death_penalty_base > 0) { if (pc_nextbaseexp(sd) > 0) - sd->status.base_exp -= - static_cast(sd->status.base_exp) * - static_cast(battle_config.death_penalty_base) / 10000; + sd->status.base_exp -= std::min(sd->status.base_exp, + static_cast(static_cast(sd->status.base_exp) * + static_cast(battle_config.death_penalty_base) / 10000)); if (battle_config.pk_mode && src && src->bl_type == BL::PC) - sd->status.base_exp -= - static_cast(sd->status.base_exp) * - static_cast(battle_config.death_penalty_base) / 10000; + sd->status.base_exp -= std::min(sd->status.base_exp, + static_cast(static_cast(sd->status.base_exp) * + static_cast(battle_config.death_penalty_base) / 10000)); } - if (sd->status.base_exp < 0) - sd->status.base_exp = 0; clif_updatestatus(sd, SP::BASEEXP); if (battle_config.death_penalty_type == 1 && battle_config.death_penalty_job > 0) - sd->status.job_exp -= - static_cast(pc_nextjobexp(sd)) * - static_cast(battle_config.death_penalty_job) / 10000; + sd->status.job_exp -= std::min(sd->status.job_exp, + static_cast(static_cast(pc_nextjobexp(sd)) * + static_cast(battle_config.death_penalty_job) / 10000)); if (battle_config.pk_mode && src && src->bl_type == BL::PC) - sd->status.job_exp -= - static_cast(pc_nextjobexp(sd)) * - static_cast(battle_config.death_penalty_job) / 10000; + sd->status.job_exp -= std::min(sd->status.job_exp, + static_cast(static_cast(pc_nextjobexp(sd)) * + static_cast(battle_config.death_penalty_job) / 10000)); else if (battle_config.death_penalty_type == 2 && battle_config.death_penalty_job > 0) { if (pc_nextjobexp(sd) > 0) - sd->status.job_exp -= - static_cast(sd->status.job_exp) * - static_cast(battle_config.death_penalty_job) / 10000; + sd->status.job_exp -= std::min(sd->status.job_exp, + static_cast(static_cast(sd->status.job_exp) * + static_cast(battle_config.death_penalty_job) / 10000)); if (battle_config.pk_mode && src && src->bl_type == BL::PC) - sd->status.job_exp -= - static_cast(sd->status.job_exp) * - static_cast(battle_config.death_penalty_job) / 10000; + sd->status.job_exp -= std::min(sd->status.job_exp, + static_cast(static_cast(sd->status.job_exp) * + static_cast(battle_config.death_penalty_job) / 10000)); } - if (sd->status.job_exp < 0) - sd->status.job_exp = 0; clif_updatestatus(sd, SP::JOBEXP); } } @@ -3709,18 +3706,18 @@ int pc_setparam(dumb_ptr sd, SP type, int val) case SP::BASEEXP: if (pc_nextbaseexp(sd) > 0) { + if (val < 0) + val = 0; sd->status.base_exp = val; - if (sd->status.base_exp < 0) - sd->status.base_exp = 0; pc_checkbaselevelup(sd); } break; case SP::JOBEXP: if (pc_nextjobexp(sd) > 0) { + if (val < 0) + val = 0; sd->status.job_exp = val; - if (sd->status.job_exp < 0) - sd->status.job_exp = 0; pc_checkjoblevelup(sd); } break; @@ -3983,11 +3980,16 @@ int pc_percentheal(dumb_ptr sd, int hp, int sp) } else { - sd->status.sp += sd->status.max_sp * sp / 100; - if (sd->status.sp > sd->status.max_sp) - sd->status.sp = sd->status.max_sp; - if (sd->status.sp < 0) - sd->status.sp = 0; + if (sp > 0) + { + sd->status.sp += sd->status.max_sp * sp / 100; + if (sd->status.sp > sd->status.max_sp) + sd->status.sp = sd->status.max_sp; + } + if (sp < 0) + { + sd->status.sp -= std::min(sd->status.sp, sd->status.max_sp * -sp / 100); + } } } if (hp) @@ -4646,7 +4648,7 @@ int pc_checkitem(dumb_ptr sd) j++; } for (k = j; k < MAX_INVENTORY; ++k) - sd->status.inventory[k] = item{}; + sd->status.inventory[k] = Item{}; for (k = j; k < MAX_INVENTORY; k++) sd->inventory_data[k] = NULL; diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 53e5c1d..87ed708 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -100,7 +100,7 @@ ADDITEM pc_checkadditem(dumb_ptr, ItemNameId, int); int pc_inventoryblank(dumb_ptr); int pc_search_inventory(dumb_ptr sd, ItemNameId item_id); int pc_payzeny(dumb_ptr, int); -PickupFail pc_additem(dumb_ptr, struct item *, int); +PickupFail pc_additem(dumb_ptr, Item *, int); int pc_getzeny(dumb_ptr, int); int pc_delitem(dumb_ptr, int, int, int); int pc_checkitem(dumb_ptr); diff --git a/src/map/script.cpp b/src/map/script.cpp index b1af725..ab9f848 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -2041,7 +2041,7 @@ void builtin_getitem(ScriptState *st) if (nameid) { - struct item item_tmp {}; + Item item_tmp {}; item_tmp.nameid = nameid; if (HARGO2(5)) //アイテムを指定したIDに渡す sd = map_id2sd(wrap(conv_num(st, &AARGO2(5)))); @@ -2099,7 +2099,7 @@ void builtin_makeitem(ScriptState *st) if (nameid) { - struct item item_tmp {}; + Item item_tmp {}; item_tmp.nameid = nameid; map_addflooritem(&item_tmp, amount, m, x, y, NULL, NULL, NULL); diff --git a/src/map/storage.cpp b/src/map/storage.cpp index f8dbd0f..e9c2cd6 100644 --- a/src/map/storage.cpp +++ b/src/map/storage.cpp @@ -102,7 +102,7 @@ int storage_storageopen(dumb_ptr sd) */ static int storage_additem(dumb_ptr sd, Storage *stor, - struct item *item_data, int amount) + Item *item_data, int amount) { struct item_data *data; int i; @@ -157,7 +157,7 @@ int storage_delitem(dumb_ptr sd, Storage *stor, stor->storage_[n].amount -= amount; if (stor->storage_[n].amount == 0) { - stor->storage_[n] = item{}; + stor->storage_[n] = Item{}; stor->storage_amount--; clif_updatestorageamount(sd, stor); } -- cgit v1.2.3-60-g2f50