Opublikowano 12 Grudnia 202412 Gru Jeśli chodzi o estetykę moim zdaniem średnio to wygląda, już lepiej jakby bg było oryginalnie i obok napisu Ekwipunek ikonka sortowania ale to tylko moja opinia i to kwestia kosmetyczna.
Opublikowano 12 Grudnia 202412 Gru 6 minut temu, Tuike napisał(a): Jeśli chodzi o estetykę moim zdaniem średnio to wygląda, już lepiej jakby bg było oryginalnie i obok napisu Ekwipunek ikonka sortowania ale to tylko moja opinia i to kwestia kosmetyczna. aa widze Nerwia style XD
Opublikowano 12 Grudnia 202412 Gru 1 minutę temu, ARK napisał(a): aa widze Nerwia style XD Ajj nigdy nie grałem na Nerwii chociaż miałem chęć ;d Jakoś taki styl bardziej wydaje mi się estetyczny.
Opublikowano 26 Kwietnia26 Kwi 2 godziny temu, WhiteBambo88 napisał(a):Fajny sposób na nieskończone auto potki xDcoś więcej? :o
Opublikowano 27 Kwietnia27 Kwi 8 godzin temu, ExoCarossa napisał(a):coś więcej? :oWarunki są tak dobrze napisane, że w przypadku autopotek zużytych prawie do zera przywraca ich wartości do full.10 godzin temu, WhiteBambo88 napisał(a):Fajny sposób na nieskończone auto potki xDMoże też zbugować wiele innych rzeczy :DWarto też wspomnieć o "wycieku pamięci", który tutaj występuje Edytowane 27 Kwietnia27 Kwi przez KoYGeR
Opublikowano 27 Kwietnia27 Kwi A no tak, to jest stackowanie w src. Były chyba 3 projekty które tego używałylagi przy stackowaniukopiowanie
Opublikowano 27 Kwietnia27 Kwi Teraz powinno nie być kopiowania. Nie sprawdzałem, możecie dać znać void CHARACTER::SortInventoryItems() { if (IsDead() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please close other windows before sorting your inventory.")); return; } int lastSortInventoryPulse = GetSortInventoryPulse(); int iPulse = thecore_pulse(); if (lastSortInventoryPulse > iPulse) { int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (iPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait %d seconds to sort your inventory again."), seconds); return; } static std::vector<LPITEM> v; v.clear(); LPITEM item; int size = INVENTORY_MAX_NUM; SetPosition(POS_FIGHTING); for (int i = 0; i < size; ++i) { if (!(item = GetInventoryItem(i))) continue; v.push_back(item); item->RemoveFromCharacter(); } std::sort(v.begin(), v.end(), [](const LPITEM& a, const LPITEM& b) { return std::string(a->GetName()) < std::string(b->GetName()); }); for (auto& it : v) { if (it) AutoGiveItem(it, false); } SetSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(10)); SetPosition(POS_STANDING); Save(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your inventory items have been sorted.")); }jeszcze tutajvoid CHARACTER::SortInventoryItems() { int lastSortInventoryPulse = GetSortInventoryPulse(); int iPulse = thecore_pulse(); if (lastSortInventoryPulse > iPulse) { int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (iPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait %d seconds to sort your inventory again."), seconds); return; } if (IsDead() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please close other windows before sorting your inventory.")); return; } SetPosition(POS_FIGHTING); static std::vector<LPITEM> v; v.clear(); LPITEM item; int size = INVENTORY_MAX_NUM; for (int i = 0; i < size; ++i) { if (!(item = GetInventoryItem(i))) continue; v.push_back(item); item->RemoveFromCharacter(); } std::sort(v.begin(), v.end(), [](const LPITEM& a, const LPITEM& b) { return std::string(a->GetName()) < std::string(b->GetName()); }); for (auto& it : v) { if (it) { AutoGiveItem(it, false); } } SetSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(10)); SetPosition(POS_STANDING); Save(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your inventory items have been sorted.")); } Edytowane 27 Kwietnia27 Kwi przez MalikOo
Opublikowano 27 Kwietnia27 Kwi 4 godziny temu, MalikOo napisał(a):Teraz powinno nie być kopiowania. Nie sprawdzałem, możecie dać znać void CHARACTER::SortInventoryItems() { if (IsDead() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please close other windows before sorting your inventory.")); return; } int lastSortInventoryPulse = GetSortInventoryPulse(); int iPulse = thecore_pulse(); if (lastSortInventoryPulse > iPulse) { int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (iPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait %d seconds to sort your inventory again."), seconds); return; } static std::vector<LPITEM> v; v.clear(); LPITEM item; int size = INVENTORY_MAX_NUM; SetPosition(POS_FIGHTING); for (int i = 0; i < size; ++i) { if (!(item = GetInventoryItem(i))) continue; v.push_back(item); item->RemoveFromCharacter(); } std::sort(v.begin(), v.end(), [](const LPITEM& a, const LPITEM& b) { return std::string(a->GetName()) < std::string(b->GetName()); }); for (auto& it : v) { if (it) AutoGiveItem(it, false); } SetSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(10)); SetPosition(POS_STANDING); Save(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your inventory items have been sorted.")); }jeszcze tutajvoid CHARACTER::SortInventoryItems() { int lastSortInventoryPulse = GetSortInventoryPulse(); int iPulse = thecore_pulse(); if (lastSortInventoryPulse > iPulse) { int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (iPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait %d seconds to sort your inventory again."), seconds); return; } if (IsDead() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please close other windows before sorting your inventory.")); return; } SetPosition(POS_FIGHTING); static std::vector<LPITEM> v; v.clear(); LPITEM item; int size = INVENTORY_MAX_NUM; for (int i = 0; i < size; ++i) { if (!(item = GetInventoryItem(i))) continue; v.push_back(item); item->RemoveFromCharacter(); } std::sort(v.begin(), v.end(), [](const LPITEM& a, const LPITEM& b) { return std::string(a->GetName()) < std::string(b->GetName()); }); for (auto& it : v) { if (it) { AutoGiveItem(it, false); } } SetSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(10)); SetPosition(POS_STANDING); Save(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your inventory items have been sorted.")); }Teraz trochę dobrych praktyk:void CHARACTER::SortInventoryItems() { const uint32_t& last_inventory_sort_pulse = GetSortInventoryPulse(); const uint32_t& cur_pulse = thecore_pulse(); if (cur_pulse < last_inventory_sort_pulse) { const uint32_t& left_seconds = static_cast<uint32_t>((last_inventory_sort_pulse - cur_pulse) / PASSES_PER_SEC(1)); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait %d seconds to sort your inventory again."), left_seconds); return; } if (IsDead() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please close other windows before sorting your inventory.")); return; } std::vector<LPITEM> v; LPITEM item; for (uint16_t i = 0; i < INVENTORY_MAX_NUM; ++i) { if ((item = GetInventoryItem(i))) { v.push_back(item); item->RemoveFromCharacter(); } } std::sort(v.begin(), v.end(), [](const LPITEM& a, const LPITEM& b) { return std::string(a->GetName()) < std::string(b->GetName()); }); for (auto& it : v) AutoGiveItem(it, false); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your inventory items have been sorted.")); SetSortInventoryPulse(cur_pulse + PASSES_PER_SEC(10)); }
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.