diff --git a/game/inv.c b/game/inv.c index 5177aeb..95c0341 100644 --- a/game/inv.c +++ b/game/inv.c @@ -2797,7 +2797,7 @@ static void rebuild_shops(const void *shop_ptr) ++state_iter; } ++shop_iter; - SEND_LOG("(SHOP) Shop found: '%s', products %d",shop_list[i]->keeper,shop_list[i]->products); + SEND_LOG("(SHOP) Shop found: '%s', id=%d, products %d",shop_list[i]->keeper,shop_list[i]->shop_id, shop_list[i]->products); } stringtable_free(stbl); free(shop_hacek); @@ -3404,20 +3404,22 @@ static void reroll_shop(TSHOP *p) } } pr=p->list; - for(i=0;ispec_max;i++) - { - int i=0; - r=rnd(poc_spec)+1; - for(j=0;imax_pocet; - if (maxp) { - *get_product_count(pr+j)=rnd(maxp)+1; - } else { - *get_product_count(pr+j) = 0; - } - } + if (poc_spec) { + for(i=0;ispec_max;i++) + { + int i=0; + r=rnd(poc_spec)+1; + for(j=0;imax_pocet; + if (maxp) { + *get_product_count(pr+j)=rnd(maxp)+1; + } else { + *get_product_count(pr+j) = 0; + } + } + } } void reroll_all_shops() diff --git a/libs/memman.c b/libs/memman.c index 0fd8921..a83ad39 100644 --- a/libs/memman.c +++ b/libs/memman.c @@ -427,7 +427,7 @@ THANDLE_DATA *def_handle(int handle,const char *filename,ABLOCK_DECODEPROC decom get_file_entry(path,h->src_file,h); } SEND_LOG("(REGISTER) File/Block registred '%-.12s' handle %04X",h->src_file,handle); - SEND_LOG("(REGISTER) Seekpos=%d",h->seekpos); + SEND_LOG("(REGISTER) Seekpos=%d",h->offset); h->flags=0; h->path=path; if (h->status!=BK_DIRLIST) h->status=BK_NOT_LOADED; diff --git a/platform/ugc.cpp b/platform/ugc.cpp index 1ccf0b9..2a78304 100644 --- a/platform/ugc.cpp +++ b/platform/ugc.cpp @@ -1,5 +1,8 @@ #include "ugc.h" #include "config.h" + +#include +#include #include #include #include @@ -16,7 +19,7 @@ std::wstring toWideChar(std::string_view text) { if ((c & 0x80) == 0) out.push_back(c); else { if ((c & 0xC0) == 0x80) { - codepoint = (codepoint << 6) | (c & 0x3F); + codepoint = (codepoint << 6) | (c & 0x3F); } else if ((c & 0xE0) == 0xC0) { bytes=2; codepoint = c & 0x1F; } else if ((c & 0xF0) == 0xE0) { @@ -81,7 +84,7 @@ constexpr std::pair cztable[]={ {0x00AB,'<'}, {0x00BB,'>'}, }; - + std::string toKEYBCS2(const char *text) { auto wstr = toWideChar(text); @@ -107,7 +110,7 @@ struct tag_UGCManager { }; UGCManager *UGC_create() { - return new UGCManager; + return new UGCManager; } void UGC_Destroy(UGCManager *inst) { delete inst; @@ -121,14 +124,14 @@ void UGCSetLocalFoler(const char *path) { size_t UGC_Fetch(UGCManager *manager) { - manager->_list.clear(); + manager->_list.clear(); std::error_code ec; auto iter = std::filesystem::directory_iterator(ugc_local_path,ec); if (ec == std::error_code()) { auto fend = std::filesystem::directory_iterator(); while (iter != fend) { const auto &entry = *iter; - if (entry.is_directory()) { + if (entry.is_directory()) { auto entry_path =std::filesystem::weakly_canonical(entry.path()) ; auto info_path = entry_path / "content.ini"; if (std::filesystem::is_regular_file(info_path)) { @@ -147,7 +150,7 @@ size_t UGC_Fetch(UGCManager *manager) { auto tlen = title.size()+1; auto alen = author.size()+1; - auto dlen = strlen(ddl)+1; + auto dlen = std::strlen(ddl)+1; r.text_data = std::make_unique(tlen+alen+dlen); char *c = r.text_data.get();